recentpopularlog in

kme : commandline   647

« earlier  
Git Aliases I Use (Because I'm Lazy) - victorzhou.com
[alias]
s = status
d = diff
co = checkout
br = branch
last = log -1 HEAD
cane = commit --amend --no-edit
lo = log --oneline -n 10
pr = pull --rebase
git  alias  shortcuts  productivity  commandline  devel 
12 days ago by kme
A (slightly) simpler command-line Spotlight search
Any qualified Spotlight query should be usable with "-interpret", so go ahead with
<code class="language-bash">mdfind -interpret "kind:image flash:1 modified:<=1/1/08 ex-girlfriend"</code>
to find those late-night pictures of last year's special someone.
macos  spotlight  metadata  mdfind  commandline  shellscripting  terminal  searchandindex  tipsandtricks  alternativeto  find 
5 weeks ago by kme
The Complete Guide to Creating Symbolic Links (aka Symlinks) on Windows
<code class="lang-batch">
:: Use /D when you want to create a soft link pointing
:: to a directory. like so:
mklink /D Link Target
</code>
symlink  junctionpoints  directoryjunction  hardlink  windows  sysadmin  cli  commandline  mklink  reference  solution  dammitbrain 
6 weeks ago by kme
windows - Run Python scripts in PowerShell directly - Super User
Edit the PATHEXT environment variable and add the .py extension.

Just add this line to your powershell profile:
<code class="language-powershell">$env:PATHEXT += ";.py"</code>

or you could just edit PATHEXT globally using the system settings (just start menu search for "Edit Environment variables for your account").


See https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles; the MS TechNet article linked in the approved answer is looooong dead.
python  powershell  windows  cli  commandline  pathext  path  environmentvariable  shellscripting  solution  essential  movein  configuration 
8 weeks ago by kme
How to list all tags of a docker image
This is one way to do this, and it works. See also this Gist, which 'docker pulls' a bunch of Bash images to see if that version of Bash has a certain 'shopt' option: https://gist.github.com/ernstki/b782cc7f2a29ec01c1f4355f2dd312cc.
<code class="language-bash">
image=debian
for (( i=0; $?==0; i++ )); do
i=$((i+1))
curl -sL https://registry.hub.docker.com/v2/repositories/library/$image/tags/?page=$i 2>/dev/null \
| jq -r '.results[]["name"]'
done</code>
You can also get the total number of tags from the "count" attribute of the first JSON response, which also gives you the "next" URL.

Possibly see also: https://docs.docker.com/v17.09/registry/spec/api/, but I don't know what the difference between Docker Hub, Docker Registry, and a Docker "Trusted" Registry is, or which one exactly the public Docker Hub is.
docker  cli  commandline  containers  automation  sysadmin  solution 
8 weeks ago by kme
passwords - MySQL Utilities - ~/.my.cnf option file - Stack Overflow
The gist is that the other utilities ('mysqldump', for example) use different "defaults groups."
mysql  commandline  cli  sysadmin  dba  newbie  question  answered  solution 
9 weeks ago by kme
GitHub - gfontenot/reflow: Intelligently reflow plain text | https://github.com/
Intelligently reflow plain text


It's just okay. The 'stack' build system is pretty nifty, though ('stack install' puts the binary in ~/.local/bin by default, which I like).
commandline  haskell  textprocessing  reflow  reformatting  markdown  alternativeto  fold  fmt  par 
july 2019 by kme
Linux command line character limit - Server Fault
The shell/OS imposed limit is generally very long - usually one or two hundred thousand characters.
<code class="language-bash">getconf ARG_MAX</code>

will give you the maximum input limit for a command. On the Debian system I currently have a terminal open on this returns 131072 which is 128*1024. The limit is reduced by your environment variables as if my memory serves me correctly these are passed in the same structure by the shell, though that will only take off a few hundred characters in most cases. To find an approximation of this value run env | wc -c - this suggests 325 characters at the current time on this login on this machine.

Scripts are likely to permit this full length, but it is not unlikely that other utilities will impose their own limits either intentionally or through design issues. There may also be artificial limits to how long an individual argument on a long command line can be, and/or how long a path to a file can be.
linux  shell  environmentsize  commandline  solution 
july 2019 by kme
[dev] Re: Auto-preview man pages from Charles Lehner on 2016-01-09 (dev mail list archive)
You could also send mupdf a SIGHUP signal to tell it to reload, instead of spawning a new mupdf:
<code class="language-bash">
mupdf address.pdf & pid="$!"
echo address.yaml | entr sh -c "make address.pdf && kill -HUP $pid"</code>
entr  automation  manpage  commandline  devel  tipsandtricks 
july 2019 by kme
GitHub - tomnomnom/gron: Make JSON greppable!
gron - Make JSON greppable!

gron transforms JSON into discrete assignments to make it easier to grep for what you want and see the absolute 'path' to it. It eases the exploration of APIs that return large blobs of JSON but have terrible documentation.
go  json  textprocessing  grep  patternmatching  webdevel  debugging  troubleshooting  commandline  cli 
july 2019 by kme
GitHub - tomnomnom/gf: A wrapper around grep, to help you grep for things
gf - A wrapper around grep to avoid typing common patterns.

What? Why?

I use grep a lot. When auditing code bases, looking at the output of meg, or just generally dealing with large amounts of data. I often end up using fairly complex patterns like this one:

▶ grep -HnrE '(\$_(POST|GET|COOKIE|REQUEST|SERVER|FILES)|php://(input|stdin))' *

It's really easy to mess up when typing all of that, and it can be hard to know if you haven't got any results because there are non to find, or because you screwed up writing the pattern or chose the wrong flags.

I wrote gf to give names to the pattern and flag combinations I use all the time. So the above command becomes simply:

▶ gf php-sources
go  cli  commandline  searching  textprocessing  patternmatching  regex  grep  alternativeto  ack  ag 
july 2019 by kme
GitHub - michenriksen/aquatone: A Tool for Domain Flyovers
If you for some reason don't trust the pre-compiled binaries, you can also compile the code yourself. You are on your own if you want to do this. I do not support compiling problems. Good luck with it!


Ha! Nice.
webmaster  scanner  recon  dns  security  cli  commandline 
july 2019 by kme
unix - ImageMagick - how to enforce min/max heights/widths? - Stack Overflow
The short answer is basically just do '200x200' and both dimensions will be reduced to no more than 200 pixels, preserving the aspect ratio.

The '-geometry' option has some weird ways of doing what seems like the same thing, like '^' and '>'; see https://www.imagemagick.org/script/command-line-processing.php#geometry.
imagemagick  commandline  imageprocessing  sortof  solution 
june 2019 by kme
Copy GPS coord tags - Wrong Hemisphere!
Add -g1 to last command to see the source of the various GPS tags.


This didn't actually help me; what helped was including *all* the tags that had to do with GPS, except the time/datestamps. I came up with this Bash function to help

<code class="language-bash"># copy EXIF GPS info including altitude from one file to another
exif_gps_from_to() {
exiftool -n -tagsFromFile "$1"\
-GPSVersionID \
-GPSLatitudeRef \
-GPSLongitudeRef \
-GPSAltitudeRef \
-GPSAltitude \
-GPSLongitude \
-GPSLatitude \
-GPSPosition \
"$2"
}
</code>
exif  jpg  jpeg  imageprocessing  gps  geo  exiftool  commandline  solution 
june 2019 by kme
How to add GPS (geolocation) tags to photos — Robert Zaremba blog
% exiftool -GPSLongitude="14.273586" -GPSLatitude="50.860361" img.png
geo  gps  jpg  exif  imageprocessing  commandline  exiftool  solution 
june 2019 by kme
How do you attach and detach from Docker's process? - Stack Overflow
To detach the tty without exiting the shell, use the escape sequence Ctrl-p Ctrl-q.

more details here: https://docs.docker.com/engine/reference/commandline/attach/

additional info from this source (https://groups.google.com/forum/#!msg/docker-user/nWXAnyLP9-M/kbv-FZpF4rUJ):

* docker run -t -i → can be detached with ^P^Qand reattached with docker attach
* docker run -i → cannot be detached with ^P^Q; will disrupt stdin
* docker run → cannot be detached with ^P^Q; can SIGKILL client; can reattach with docker attach
docker  commandline  tipsandtricks  solution  fuckina 
june 2019 by kme
docker attach | Docker Documentation
To stop a container, use CTRL-c. This key sequence sends SIGKILL to the container. If --sig-proxy is true (the default), CTRL-c sends a SIGINT to the container. You can detach from a container and leave it running using the CTRL-p CTRL-q key sequence.
docker  commandline  reference 
june 2019 by kme
GitHub - nemanjan00/uniread: Uniread is Spritz like CLI fast reading software.
Uniread is Spritz like CLI fast reading software. - nemanjan00/uniread
ebook  speadreading  reader  app  npm  javascript  cli  commandline 
june 2019 by kme
How to View a Certificate Fingerprint as SHA-256, SHA-1 or MD5 using OpenSSL
How to View a Certificate Thumbprint as SHA-256, SHA-1 or MD5 using OpenSSL How to View a Certificate Fingerprint as SHA-256, SHA-1 or MD5 using OpenSSL
openssl  x509  crypto  ssl  certificate  sha1  sha256  hash  fingerprint  commandline  solution 
june 2019 by kme
GitHub - h2non/nar: node.js application archive - create self-contained binary like executable applications that are ready to ship and run
node.js application archive - create self-contained binary like executable applications that are ready to ship and run - h2non/nar
shroudedscript  shrouding  javascript  nodejs  commandline  packaging 
june 2019 by kme
yest download | SourceForge.net
Needs to be modified to support 'now', or 'today' as starting time/dates.
Download yest for free. This is a command line date/time manipulation and formatting program, very useful in scripts. You can easily add or subtract days, hours and/or minutes from a specified date.
timeanddate  unix  c  shellscripting  commandline  essential  movein  needshelp 
june 2019 by kme
GitHub - alex/csv-sql: Query your CSV files with SQL
Query your CSV files with SQL. Contribute to alex/csv-sql development by creating an account on GitHub.
csv  sql  datamining  commandline  rust  textprocessing 
june 2019 by kme
macos - How to check whether there is bad sector on an external USB hard disk on OS X? - Super User

The OS X built in command fsck_hfs has an option -S that apparently will check whether there is bad block on a USB hard disk on OS X.

From the official man page:
<code>-S Cause fsck_hfs to scan the entire device looking for I/O
errors. It will attempt to map the blocks with errors to names,
similar to the -B option.</code>

Example:
<code class="language-bash">fsck_hfs -fy -S /dev/disk3s11</code>

It seems to be doing that when run on partitions without bad blocks but I've yet to check/document what it does when there are bad blocks.
storage  disasterrecovery  hardwaremonitoring  repair  commandline  mac  osx  fsck 
may 2019 by kme
BurntSushi/xsv: A fast CSV command line toolkit written in Rust. - https://github.com/
A fast CSV command line toolkit written in Rust. Contribute to BurntSushi/xsv development by creating an account on GitHub.
rust  csv  textprocessing  commandline 
april 2019 by kme
A ~/.inputrc for Humans - Top Bug Net | https://www.topbug.net/
<code class="language-inputrc">
$include /etc/inputrc
"\C-p":history-search-backward
"\C-n":history-search-forward

set colored-stats On
set completion-ignore-case On
set completion-prefix-display-length 3
set mark-symlinked-directories On
set show-all-if-ambiguous On
set show-all-if-unmodified On
set visible-stats On
</code>

I would add these, too:
<code class="language-inputrc">
$if mode=vi
set keymap vi-command
# these are for vi-command mode
"\e[A": history-search-backward
"\e[B": history-search-forward

set keymap vi-insert
# these are for vi-insert mode
"\e[A": history-search-backward
"\e[B": history-search-forward

# source: https://brettterpstra.com/2015/07/09/shell-tricks-inputrc-binding-fun/
"\e[1;5C": forward-word
"\e[1;5D": backward-word
$endif
</code>
bash  commandline  editing  configfile  dotfile  movein  essential  newbie  inputrc  readline 
april 2019 by kme
Intrepid command line directory traversal - BrettTerpstra.com | https://brettterpstra.com/
I use Terminal (well, iTerm 2) for file management on my Mac more often than I use Finder. Typing out long path names is often more tedious than drilling through Finder folders, though. I have enough
unix  shell  bash  commandline  filesystemnavigation  tipsandtricks 
april 2019 by kme
GitHub - twosigma/ngrid: It's "less" for data! | https://github.com/
It's "less" for data! Contribute to twosigma/ngrid development by creating an account on GitHub.
python  commandline  tui  curses  tsv  data  viewertextprocessing  alternativeto  less  vv  csvkit  csvlook 
march 2019 by kme
swcarpentry/windows-installer: Software Carpentry installer for Windows. | https://github.com/
Software Carpentry installer for Windows. Contribute to swcarpentry/windows-installer development by creating an account on GitHub.
workshop  windows  unix  msysgit  commandline  bash  installation  installer  script  python 
february 2019 by kme
sourcefrog/conserve: [alpha] robust portable file backup tool in Rust | https://github.com/
[alpha] robust portable file backup tool in Rust. Contribute to sourcefrog/conserve development by creating an account on GitHub.
sysadmin  backup  backupandrecovery  commandline  rust  alternativeto  duplicity 
february 2019 by kme
bup/bup: Very efficient backup system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). Current release is 0.29.2, and the development branch is master.
Very efficient backup system based on the git packfile format, providing fast incremental saves and global deduplication (among and within files, including virtual machine images). Current release is 0.29.2, and the development branch is master. Please post problems or patches to the mailing list for discussion (see the end of the README below). - bup/bup
git  backup  packfile  backupandrecovery  utility  commandline  alternativeto  duplicity 
february 2019 by kme
« earlier      
per page:    204080120160

Copy this bookmark:





to read