Skip to content

Instantly share code, notes, and snippets.

@stalent
stalent / gist:0d7d5fa8f555887d057d6c7cf4d0c3a0
Created May 12, 2018 10:57 — forked from gerjantd/gist:6ada8e54c60400725e19
ubuntu apt-get update boot no space left on device
sudo apt-get update
sudo apt-get upgrade
dpkg -l linux-image-\* | grep ^ii
kernelver=$(uname -r | sed -r 's/-[a-z]+//')
echo $kernelver
dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve $kernelver
sudo apt-get purge linux-image-3.13.0-{34,35,36,37,40}
sudo apt-get purge linux-headers-3.13.0-{34,35,36,37,40}
@stalent
stalent / gist:fa5daf5e3aa6cf369e04709e50b96ce3
Created May 12, 2018 11:03 — forked from gerjantd/gist:9787538
Bash/nc: netcat as a simple ftp server
DATA TRANSFER
The example in the previous section can be expanded to build a basic data transfer model. Any information input into one end of the connection will be output to the other end, and input and output can be easily captured in order to emulate file trans‐
fer.
Start by using nc to listen on a specific port, with output captured into a file:
$ nc -l 1234 > filename.out
Using a second machine, connect to the listening nc process, feeding it the file which is to be transferred:
@stalent
stalent / list_manually_installed_packages.py
Created May 12, 2018 11:05 — forked from gerjantd/list_manually_installed_packages.py
Python, Debian, Ubuntu: list manually installed packages
"""List manually installed debian packages
Use as root or with sudo:
python list_manually_installed_packages.py [date]
output results to /var/log/manually_installed_software_<hostname>.csv
Optional argument [date] will list only packages installed since that date.
The date format is YYYYMMDD and be used e.g. as
____
_________ / _/___ ___ _____
/ ___/ __ \ / // __ \/ _ \/ ___/
(__ ) / / // // /_/ / __/ /
/____/_/ /_/___/ .___/\___/_/
/_/
+ -- --=[http://crowdshield.com