Posts

Showing posts from August 14, 2018

Expect, Command, Pipes and Gzip

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite I am trying to work with the expect command, everything works well until I try to pipe the results of a command into a Gzip file. Here is the snippet of the bash file: XYZ=$(expect -c " spawn python log-connector.py -s $strt -e $end -i 600 -a https://server:9000 -u someaccount -f ./conf/firewall-fields2.txt -q ./conf/query.txt -z | gzip >> /data/sources/results-$strt2-$end2.json.gz expect "Password:" send "$passr" interact ") echo "$XYZ" $start - variable (start date) $end - variable (end date) $strt2 - variable (start date with 00:00) $end2 - variable (end date with 23:59) $pass - Password entered by the user previously. If I remove | gzip >> /data/sources/results-$strt2-$end2.json.gz from the above it works as expected. When I add it I get the following error: send: spawn id exp7 not open while executing usage: API [-h] [-s START] [-e END] [-d DAY] [-i IN

Systemd private /tmp on Debian, can't disable it on the right way

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite I know it is against the rules of this site to say good morning but... "Private /tmp is just like a good idea... it worked for me, it is more safe, so lets redistribute to every unix-man in the world that expects /tmp is /tmp since 1970..." What do you get? Explosion, destruction and your body on fire.... I am trying to disable private /tmp on Debian 9, so i follow the instructions from this site: https://www.maxoberberger.net/blog/2017/10/debian-9-private-tmp.html It seems pretty nice but it is not and it is causing some heartache... When i tried to disable creating a override file on /etc/systemd/system/apache2.service, systemd seems to ignored me completely. I am needing to edit the file directly in: /lib/systemd/system/apache2.service So it works , but that is not really a good idea specially if you upgrade your system... today unatended-upgrade runned and everything is broken because of private tm