This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# put it in /etc/init/app-name.conf | |
# | |
# Usage run: | |
# start app-name | |
# stop app-name | |
description "Eldes Alarm Server (Ukmerges g. gate)" | |
author "eldes - http://eldes.lt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
description "Eldes Alarm Server (Ukmerges g. gate)" | |
author "tk - http://tadas.kacinskas.eu" | |
# used to be: start on startup | |
# until we found some mounts weren't ready yet while booting: | |
start on started mountall | |
stop on shutdown | |
# Automatically Respawn: | |
respawn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Got a shell script that you want automatically run at bootup on Ubuntu Server Edition? Here’s how: | |
Create a script in the /etc/init.d/ directory | |
Make the script executable | |
$ sudo chmod +x /etc/init.d/myscript.sh | |
Make the script start at bootup | |
$ sudo update-rc.d myscript.sh defaults | |
Note: the option “defaults” puts a link to start your script in runlevels 2, 3, 4 and 5, and puts a link to stop in runlevels 0, 1 and 6. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Demo - http://jsfiddle.net/tadas/uRwGX/1/ | |
/* ---------------------------- */ | |
// Scroll to top | |
/* ---------------------------- */ | |
$(function() { | |
var $simpleScrollTop=$('#scrolltop'); | |
$(window).scroll(function() { | |
if($(this).scrollTop() != 0) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Postfix | |
$ sudo /etc/init.d/postfix start/stop/restart/... | |
//mail quene | |
$ mailq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
siege -c20 www.google.co.uk -b -t30s | |
# With the following command, we’ll test Google with 20 concurrent connections for 30 seconds, and then get a nice report at the end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Count all: netstat -an | wc -l | |
Filter by port: netstat -an | grep :80 | wc -l | |
Group by status: netstat -ant | awk '{print $6}' | sort | uniq -c | sort -n |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat ~/.ssh/id_rsa.pub | ssh hostname 'cat >> ~/.ssh/authorized_keys' | |
-OR- | |
sh-copy-id -i ~/.ssh/id_rsa.pub username:[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create file 'config' in '~/.ssh': | |
IdentityFile ~/.ssh/identity | |
IdentityFile ~/.ssh/id_rsa | |
IdentityFile ~/.ssh/gitid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh-copy-id -i ~/.ssh/id_rsa.pub remote-host |