recentpopularlog in
« earlier   later »
RSSPreview – Get this Extension for 🦊 Firefox (en-US)
This is the good one; it has a preview of the feed that doesn't require clicking on anything.
firefox  addon  extension  webextension  quantum  rss  feedreader 
11 weeks ago
github - How can I determine the URL that a local Git repository was originally cloned from? - Stack Overflow | https://stackoverflow.com/
Newer gits also have 'git remote get-url'.
If you want only the remote URL, or if your are not connected to a network that can reach the remote repo:
<code class="language-bash">
git config --get remote.origin.url
</code>
If you require full output and you are on a network that can reach the remote repo where the origin resides :
<code class="language-bash">
git remote show origin
</code>
git  remote  git-remote  url  shellscripting  scripting  solution 
11 weeks ago
#927669 - nvpy: could not connect to simplenote server - Debian Bug report logs | https://bugs.debian.org/
This is the standard 'nvpy' package in Ubuntu 18.04. The reason is because 1.0.0 uses the retired Simplenote API. RIP.

Solution is to install it with pip3.
nvpy  debian  ubuntu  simplenote  bug  workaround 
11 weeks ago
How do I retrieve the terminal width in Perl? - Stack Overflow
<code class="language-perl">use Term::ReadKey;
($wchar, $hchar, $wpixels, $hpixels) = Term::ReadKey::GetTerminalSize();</code>

Or:
<code class="language-perl">my $width = `tput cols`;</code>
perl  terminal  tui  shellscripting  solution 
11 weeks ago
Going mad(1) - TJ Holowaychuk
mad(1) is a tiny tool that allows you to view markdown manual pages. I’m a huge fan of man in general, but the format is pretty annoying and often converted from markdown, textile etc anyway. The output man produces is also pretty bad in my opinion, mainly whitespace issues.
bash  shell  markdown  quickreference  viewer  alternativeto  mdless  mdv  nd 
11 weeks ago
tj/mad: mad(1) is a markdown manual page viewer
Probably want to apply https://github.com/tj/mad/pull/22 right away, and 'cp *.md' from https://github.com/tj/mad-pages to ~/.local/share/mad.

This is also a really good template for new Bash utility scripts (good options parsing, local config, a 'share' directory, Makefile, self-update feature).
markdown  cli  commandline  viewer  bash  alternativeto  mdless  mdv  nd  quickreference  inspiration 
11 weeks ago
power management - How do I disable my system from going to sleep? - Ask Ubuntu | https://askubuntu.com/
Why the fuck doesn't the System Settings "Sleep after inactive for" setting do this this?
On Ubuntu 16.04 LTS, I successfully used the following to disable suspend:
<code class="language-bash">
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
</code>
And this to re-enable it:
<code class="language-bash">
sudo systemctl unmask sleep.target suspend.target hibernate.target hybrid-sleep.target
</code>
ubuntu  elementaryos  annoyance  sleep  suspend  powersave  powermanagement  systemd  maybesolution 
12 weeks ago
grub2 - How to get to the GRUB menu at boot-time? - Ask Ubuntu | https://askubuntu.com/
Menu will appear if you press and hold Shift during loading Grub, if you boot using BIOS. When your system boots using UEFI, press Esc.

For permanent change you'll need to edit your /etc/default/grub file -- place a "#" symbol at the start of line GRUB_HIDDEN_TIMEOUT=0.

Save changes and run sudo update-grub to apply changes.

Documentation: https://help.ubuntu.com/community/Grub2
grub  bootmanager  dammitbrain  solution 
12 weeks ago
HTTP range requests - HTTP | MDN | https://developer.mozilla.org/
If the Accept-Ranges is present in HTTP responses (and its value isn't "none"), the server supports range requests. You can check this by issuing a HEAD request with cURL, for example.
<code class="language-bash">
curl -I http://i.imgur.com/z4d4kWk.jpg

# result:
# HTTP/1.1 200 OK
# ...
# Accept-Ranges: bytes
# Content-Length: 146515
</code>
curl  http  rangerequest  partialdownloads  resume  webdevel  solution  reference 
12 weeks ago
Troubleshooting the Windows Subsystem for Linux | Microsoft Docs | https://docs.microsoft.com/
Do this is an admin PowerShell
<code class="language-powershell">
Get-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
</code>
windows  wsl  linux  virtualization  troubleshooting 
12 weeks ago
cmd - openssl hangs and does not exit - Stack Overflow | https://stackoverflow.com/
<code class="language-bash">echo | openssl s_client -showcerts -connect google.com:443 > cert.txt</code> or <code class="language-bash">openssl s_client -showcerts -connect google.com:443 </dev/null >cert.txt</code>
openssl  s_client  annoyance  solution 
12 weeks ago
GNU Core Utilities Frequently Asked Questions - https://www.gnu.org/
Useful:
<code class="language-bash"> alias del='mv --verbose --backup=simple --suffix=$(date +".(%F_%T)") --target-directory=$HOME/.Trash/'</code>

See also: http://gentoo-wiki.com/HOWTO_Move_Files_to_a_Trash
linux  storage  extfs  ext2fs  ext3fs  ext4fs  undelete  reference 
january 2020
GNU Core Utilities Frequently Asked Questions - https://www.gnu.org/
The GNU chown program will change the ownership if the operating system it is running upon allows it. If you can’t change file ownership then it is the operating system which is restricting you and not the chown program.

Actually, the GNU chown command does not know if this is the policy of the system or not. It calls the kernel system call chown() just like any other program (e.g. perl, ruby, etc.) If the OS allows it then it will change the ownership of the file. Different systems handle this differently. Traditional System V Unix systems allow anyone to give a file away to other owners. On those systems GNU chown does change the ownership of files.

But on most modern systems BSD semantics are followed and only the superuser can change the ownership of the file. The problem for documenting this is that GNU chown does not know which it will be running on. It could be one or it could be the other. Or it might even be running on a system without the concept of file ownership at all! This is really an OS policy decision and it is hard to track documentation to be different on different systems. But the documentation must be independent of operating system.

The reason an operating system needs to restrict changing ownership is mostly threefold.

A user can create files that they cannot remove. With the old semantics it was possible for normal users to create situations that only the superuser could fix, such as creating a non-writable directory of files and then giving the ownership away. Since they no longer own the files they can’t change them, nor can they remove them. This is commonly a problem when untaring files that other people created with restrictive file permissions. The new semantics avoid this problem entirely. Therefore most systems today have been changed to disallow giving file ownership away. But as noted it has not always been that way.
Additionally systems need to restrict who can remove files from system temporary directories such as /tmp. Otherwise anyone could remove any file there which might disrupt system processes. Some programs might even have security issues associated with this. Therefore modern systems set the ’sticky’ bit on /tmp. This is the ’t’ bit. On directories this prevents users from removing or renaming a file unless they own the file or directory. The reason this is important is that if chown is allowed then /tmp is another place that a file could be created by a user, chowned, and then could not be removed by the user. A sticky /tmp and a restricted chown policy go together. If you have one then you should have the other as well.
People have used this to avoid disk space quota restrictions. Give the file to someone either with disk quota to spare or without any quota restrictions, like root. You can always copy the files back and then you own them again. This effectively defeats any quota system if allowed. Also, you can deny someone else service with a denial of service attack by using all of their quota until they cannot create any files. You use up their quota by chowning files to them someplace where they cannot find them.
gnu  linux  coreutils  chown  permissions  unix  sothatswhy 
january 2020
Hashing it Out in PowerShell: Using Get-FileHash | https://www.petri.com/
Windows 7, even with all the updates, only has PowerShell 2.0, so no 'get-filehash' for Windows 7.
PowerShell 4.0 introduced a new cmdlet, Get-FileHash, primarily for use with Desired State Configuration (DSC). In a pull server configuration, you need to provide file hashes so that servers can recognize changes. That is the primary purpose of a file hash as far as I am concerned is for file integrity. Windows supports several different hashing algorithms, which you should not confuse with encryption.
powershell  hash  checksum  crypto  windows  win7  shellscripting 
january 2020
lucasg/powershell-docset: A dash docset for powershell modules : https://docs.microsoft.com/en-us/powershell/module/ | https://github.com/
Get a release, and then extract the .tgz for a specific version, then move the "Powershell.docset" directory into ~/.local/share/Zeal/Zeal
zeal  dash  velocity  docset  powershell  devel  reference  solution 
january 2020
How to add separator in powershell - Stack Overflow
Basically, use 'export-csv' or 'converto-csv' with a '-delimiter' option.
csv  windows  powershell  shellscripting  textprocessing  newbie  solution 
january 2020
How do I concatenate strings and variables in PowerShell? - Stack Overflow
This was my solution:

<code class="lang-powershell">gci -recurse -include *.exe,*.msi |
%{ get-filehash $_ -a SHA1 } |
%{ write-host $(
$_.hash + " " +
$(Resolve-Path -Relative $_.path | %{$_ -split "\\" -join "/"})
)
}</code>
powershell  stringmanipulation  textprocessing  shellscripting  syntax  solution 
january 2020
.net - What does $_ TRULY mean in PowerShell? - Stack Overflow
The $_ is only created in the context of a pipeline, that is the passing of output objects from one command into the "input" of another. For pipeline filters (which are like functions), powershell automatically populates the $_ variable with the current object of the pipeline. Now I say current because it is important to note that when multiple objects are passed down the pipeline, the process scriptblock of your filter is executed once per object.
windows  powershell  shellscripting  iteration  pipes  syntax  newbie  solution 
january 2020
« earlier      later »
per page:    204080120160

Copy this bookmark:





to read