receiving end (using port 10000):
nc -l 10000 | tar x
sending end:
cd parent_dir
tar cf - *hello* | nc receiving_hostname 10000
martes, 10 de junio de 2014
miércoles, 18 de diciembre de 2013
How do I add text to the beginning of a file
sed -i '1iline text at the beginning' hello.txt
http://superuser.com/questions/246837/how-do-i-add-text-to-the-beginning-of-a-file-in-bash
http://superuser.com/questions/246837/how-do-i-add-text-to-the-beginning-of-a-file-in-bash
martes, 26 de noviembre de 2013
Test if string is a number in Ruby
def is_number?(object)
true if Float(object) rescue false
end
(http://stackoverflow.com/questions/5661466/test-if-string-is-a-number-in-ruby-on-rails)
viernes, 9 de agosto de 2013
strace for parent and threads and output to files
sudo strace -tt -s 1024 -o strace.log -ffv -p {pid}
miércoles, 7 de agosto de 2013
martes, 9 de julio de 2013
viernes, 7 de junio de 2013
grep output only part of matching regex
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"'
ETag: "ae02fff4e2395982747582496ada225d"
#I want just the ETag value:
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"' |grep -oP '(?<=ETag: ")\w+(?=")'
ae02fff4e2395982747582496ada225d
Ref: http://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match
ETag: "ae02fff4e2395982747582496ada225d"
#I want just the ETag value:
$ echo 'ETag: "ae02fff4e2395982747582496ada225d"' |grep -oP '(?<=ETag: ")\w+(?=")'
ae02fff4e2395982747582496ada225d
Ref: http://unix.stackexchange.com/questions/13466/can-grep-output-only-specified-groupings-that-match
Suscribirse a:
Entradas (Atom)