Skip to content

Instantly share code, notes, and snippets.

View kostyrev's full-sized avatar
🇫🇷
Вы что, хотите чтобы было как в Париже?

Aleksandr Kostyrev kostyrev

🇫🇷
Вы что, хотите чтобы было как в Париже?
View GitHub Profile
@kostyrev
kostyrev / gist:08433aa4130c14f3e2351a87a26b0938
Created November 15, 2017 19:27
list deleted files from .git
git rev-list --all --objects | sed -n $(git rev-list --objects --all | cut -f1 -d' ' | git cat-file --batch-check | grep blob | sort -n -k 3 | tail -n1 | while read hash type size; do echo -n "-e s/$hash/$size/p "; done) | sort -n -k1
@kostyrev
kostyrev / gist:f1af31dafa5704fcd47e2307667d2db4
Created February 5, 2017 20:55
running a command against every line in a textfile
xargs -0 -n 1 chmod 644 < <(tr \\n \\0 <filelist.txt)
So, this will run xargs on the std. input (filelist.txt).
-n is max arguments – in this case we have 1 arg. (the list of files in the file – per line).
-0 means that input lines are terminated by a null char, not a whitespace, to keep things tidy.
Finally, we run tr which deletes characters, in this case removing the newlines and whitespace.
seq 1 13 | xargs -I {} date -d "2016-08-26 {} days" +%d.%m.%Y
rsync -i http://yum.puppetlabs.com ::packages/yum/
lsof -Pan -p $(pgrep opentracker) -i
- include: "{{ ansible_os_family }}".yml
rpm -qR $(rpm -q --qf '%{name} ' --specfile *.spec | cut -d ' ' -f1)
find . -type f -name "log*" -print0 | xargs -0 truncate -s 0
echo -n "Max open files=soft:hard" > /proc/pid/limits
journalctl _PID=1