Sometimes it’s handy to be able to directly append to a remote file. Here is how to do it simply:
cat my_file | ssh user@host 'dd of=/home/user/outfile oflag=append conv=notrunc'
#TipOfTheDay
Sometimes it’s handy to be able to directly append to a remote file. Here is how to do it simply:
cat my_file | ssh user@host 'dd of=/home/user/outfile oflag=append conv=notrunc'
#TipOfTheDay
And some other types too.
Fun article to read here: https://blog.lastinfirstout.net/2009/11/cargo-cult-system-administration.html
One particularly right: “Asserting that [Technology O] or [Platform L] or [Methodology A] is inherently superior to all others and blindly applying it to all problems. When you make such claims, are you applying science or religion?”
“It’s easy to fall into cargo cult mode.
Just re-boot it, it’ll be fine.” – Michael Janke
Tip submitted by my friend J.K when we were in need of a way to recover reserved cache space without booting.
In root:
PageCache only: sync ; echo 1 > /proc/sys/vm/drop_caches Dentries and inodes: sync ; echo 2 > /proc/sys/vm/drop_caches PageCache, Dentries and inodes: (not recommanded in production as it forces a full cache rebuilt. you may still need it): sync ; echo 3 > /proc/sys/vm/drop_caches
In case you need to do it in a sudo:
echo 3 | sudo tee /proc/sys/vm/drop_caches
If ever you need to sort log messages by their log level yo may need to change the default output format of the syslog.
For rsyslog it’s located in /etc/rsyslogd.conf. Add these lines after the line “$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat” :
$template precise,”%timegenerated% %HOSTNAME% {%syslogpriority%,%syslogfacility%} %syslogtag% %msg%\n”
$ActionFileDefaultTemplate precise
Then restart rsyslogd:
sudo service rsyslog restart
#rsyslogd #syslog #log #loglevel #facilities
Case:
WARNING**: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
Solved by adding NO_AT_BRIDGE=1 before launching gvim ( i.e [user@server]$ NO_AT_BRIDGE=1 gvim myfile.txt) source: https://github.com/NixOS/nixpkgs/issues/16327
Case:
connect /tmp/.X11-unix/X0: Permission denied
E233: cannot open display
Press ENTER or type command to continue
Solved by using correct DISPLAY informations before connecting (DISPLAY=localhost:0.0) source: https://unix.stackexchange.com/a/220234
Happy birthday Judicael 😉
#SEO