cat /some/file/path.txt | awk '{ print $5}' | uniq -c
Friday, July 28, 2017
count unique values in rows with bash, grep and awk
Sunday, July 16, 2017
backup sites with cron and ssh
# m h dom mon dow command
33 0 * * * /usr/bin/ssh root@lunch-break.ro "/bin/tar czf - /home/www/bla " > \ /home/emilper/backup/bla/www_bla_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.tar.gz 2>>/tmp/cron.log 52 0 * * * /usr/bin/ssh root@lunch-break.ro "mysqldump -u root -pblabla --opt bla_db | \ gzip -9c " > /home/emilper/backup/bla/bla_db_mysql_dump_`date +\%Y-\%m-\%d_\%H-\%M-\%S`.gz \ 2>>/tmp/cron.log
Saturday, July 8, 2017
perl compiled under 5 minutes with perlbrew on a Ryzen 7
emilper@home ~ $ time perlbrew install -j8 -Dusethreads -Duselargefiles -Dcccdlflags=-fPIC -Duse64bitint -Dpager=/usr/bin/sensible-pager -Uafs -Ud_csh -Ud_ualarm -Uusesfio -Uusenm -Doptimize=-O2 -Duseshrplib perl-5.20.3
Installing /home/emilper/perl5/perlbrew/build/perl-5.20.3 into ~/perl5/perlbrew/perls/perl-5.20.3
This could take a while. You can run the following command on another shell to track the status:
tail -f ~/perl5/perlbrew/build.perl-5.20.3.log
perl-5.20.3 is successfully installed.
real 3m50.827s
user 10m8.356s
sys 0m39.784s
Sunday, May 21, 2017
upgraded to linux kernel 4.8
I upgraded my Linux Mint 18.1 to the 4.8 kernel and was left without network and sound. To fix that all I needed to do was to install the linux-image-extra, which I don't remember ever needing to install explicitly:
Saving here because it took me a couple of hours until I got to this solution.
sudo apt-get install linux-image-extra-4.8.0-52-generic
Saving here because it took me a couple of hours until I got to this solution.
Wednesday, April 19, 2017
update on Gedit plugin to format JSON
what changed: $j->canonical([1]) - this will sort the keys in the json objects
#!/usr/bin/env perl use strict; use JSON::XS; local $/ = undef; my $content =; my $j = JSON::XS->new->utf8->pretty(1); $j->canonical([1]); my $output = $j->encode($j->decode($content)); print $output;
Tuesday, October 11, 2016
build dstep on Linux Mint 17.2
while trying to build dstep (a tool to convert C header files to D modules):
$ dub Running pre-generate commands for dstep... Performing "debug" build using dmd for x86_64. dstep 0.2.2+commit.121.gf55746e: building configuration "default"... Linking... /usr/bin/ld: cannot find -lclang collect2: error: ld returned 1 exit status --- errorlevel 1 dmd failed with exit code 1.
Had all the clang libs (including the *-dev packages) installed but it did not change. Here was the solution:
$sudo su - #cd /usr/lib/x86_64-linux-gnu #ln -s libclang.so.1 libclang.so
setting up printer Brother HL-1212W on Linux Mint 17.2
it was underwhelming:
Click on the Mint button-> search for Printers -> add printer -> Network -> wait 1 second until the printer is found and the name is shown -> add it -> pick the recommended driver -> print test page to make sure. Total time: about 3 minutes.
You need to configure it to connect to the wireless network from windows first though.
Click on the Mint button-> search for Printers -> add printer -> Network -> wait 1 second until the printer is found and the name is shown -> add it -> pick the recommended driver -> print test page to make sure. Total time: about 3 minutes.
You need to configure it to connect to the wireless network from windows first though.
Subscribe to:
Posts (Atom)