Be VERY CAREFUL with this.
sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
😉 nJoy
Be VERY CAREFUL with this.
sudo dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
😉 nJoy
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
source /etc/lsb-release
echo "deb https://repos.influxdata.com/${DISTRIB_ID,,} ${DISTRIB_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/influxdb.list
sudo apt-get update && sudo apt-get install influxdb
sudo service influxdb start
nJoy 😉
sudo apt-get remove influxdb
apt-get purge influxdb
nJoy 😉
Referring to the github README.md https://github.com/pm2-hive/pm2-logrotate
pm2 install pm2-logrotate@2.6.0
pm2 set pm2-logrotate:compress true
pm2 set pm2-logrotate:max_size 10M
pm2 set pm2-logrotate:retain 7
pm2 conf
{
"pm2-logrotate": {
"max_size": "10M",
"retain": "7",
"compress": "true",
"dateFormat": "YYYY-MM-DD_HH-mm-ss",
"workerInterval": "30",
"rotateInterval": "0 0 * * *",
"rotateModule": true
},
"module-db": {
"pm2-logrotate": {
"uid": null,
"gid": null
}
}
}
nJoy 😉
ulimit -c unlimited
nJoy 😉
This is a simple script to get all cronjbs for all users on a system
for someone in $(cut -f1 -d: /etc/passwd); do echo $someone; crontab -u $someone -l ; done
nJoy 😉
Inside your incrontabs, you must leave *only* 1 space between the <path> <mask> <cmd>. If you leave 2 or more spaces, then the 2nd (and more) spaces will be considered part of the <mask> or <cmd> and it will fail… I was leaving 2 spaces between <mask> and <cmd>, and incron did not work and in /var/log/syslog there were these messages
incrond[27693]: cannot exec process: No such file or directory
This was because of having 2 spaces… when I corrected to only 1 space, it began working correctly. Keep it in mind, so you dont suffer as much as I did to find it out
After editing with “incrontab -e”, check that “incrontab -l” shows the rules. If it does not show some rule, then that is because that rule has some error and was not recognized.
To debug what is happening behind the curtains, its usefull to have a “tail -f /var/log/syslog” on another terminal…
Quoted from https://zipizap.wordpress.com/2013/11/15/incron/
Very useful thanks !
😉 nJoy
This is as bare a node App as you can make but it comes in handy when you want a . dummy server just to return 200s and or a JSON object at super fast speeds on small systems:
var express = require('express'); var app = express(); app.get('*', function(req, res) { res.sendStatus(200); }); app.listen('3000'); console.log('Magic happens on port 3000'); exports = module.exports = app;Before running the js file runnpm install express
to deploy express..
Thats it !
nJoy 😉
Hi,
Ubuntu does not carry chkconfig any more ..
besides the standard
update-rc.d apache2 defaults
or
update-rc.d apache2 remove
There is a cool tool called : sysv-rc-conf.
This tool can be installed using :
sudo apt-get install sysv-rc-conf
On its own the command opens a cool ncurses interface like this :
It can Also be used in scripts as :
sysv-rc-conf atd <on or off> and --levels;
man sysv-rc-conf
Will give you some love..
nJoy 😉
To find out what triggered this use :
more /var/run/reboot-required.pkgs
nJoy 😉