Showing posts with label server. Show all posts
Showing posts with label server. Show all posts

Monday, 8 August 2016

Regenerate TS3 priv key

If you need to regenerate the ts3 priv key you can start the server with a temp admin key using

ts3server_minimal.sh serveradmin_password=YourNewPassWord
(http://shawnhyde.com/post/2010/01/12/How-to-recover-serveradmin-access-of-teamspeak3ts3-server-after-system-reload)

Login with:
login serveradmin password

Then generate key with:
use 1 tokenadd tokentype=0 tokenid1=6 tokenid2=0

(https://freevps.us/thread-11350.html)

Wednesday, 13 March 2013

Remove unused kernels and headers from ubuntu server

Yet again I found my system clogged up with unused kernels and headers. This time I am making a note of the one-liner to remove the unused junk.

(Found at http://tuxtweaks.com/2010/10/remove-old-kernels-in-ubuntu-with-one-command/)

You can first check that the correct packages are selected to remove with;

 dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get --dry-run remove 

and if you are happy remove those with this;

dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | xargs sudo apt-get -y purge


A word of warning, if you have installed a new kernel recently ensure you have rebooted since, and secondly ensure that your current kernel is not on the list of packages to remove of you will end up with a un-bootable system.

Sunday, 23 September 2012

Specifying IP range for tcpdump

I recently came across the need to specify a IP range for tcpdump (setting up an install of darkstat to monitor network usage by host - but ignoring traffic within my local network).

However the only solution I could find in pcap-filter syntax was to specify blocks of ip's by netmask.

After looking into filtering ip addressea by inspecting the packets themselves, (http://isc.sans.edu/diary.html?storyid=6667) I finally came across a comment on the bottom of the previous link which suggested using a script cidr_range.pl (http://archives.neohapsis.com/archives/postfix/2005-06/att-1279/cidr_range__charset_iso-8859-15) which translated ip ranges into a series of ip/cidr netmasks that can them be used to filter tcpdump (or in my case darkstat).

Therefore

steve@dell-laptop:~$ perl cidr_range.pl 192.168.0.100 192.168.0.200
192.168.0.100/30
192.168.0.104/29
192.168.0.112/28
192.168.0.128/26
192.168.0.192/29
192.168.0.200/32
can then be translated to

not (net 192.168.0.100/30 or net 192.168.0.104/29 or net 192.168.0.112/28 or net 192.168.0.128/26 or net 192.168.0.192/29 or net 192.168.0.200/32)

which then filters out all traffic to or from hosts within the range 192.168.0.100-200.

Steve

Refs:
http://archives.neohapsis.com/archives/postfix/2005-06/att-1279/cidr_range__charset_iso-8859-15
http://isc.sans.edu/diary.html?storyid=6667
http://www.manpagez.com/man/7/pcap-filter/
http://www.tcpdump.org/tcpdump_man.html