SSH tunnel for mySQL
ssh -f -L 3306:127.0.0.1:3306 username@servername.com sleep 120
Should auto-disconnect when it’s no longer in use.
1451 users tagging and storing useful source code snippets
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
ssh -f -L 3306:127.0.0.1:3306 username@servername.com sleep 120
cat .ssh/id_dsa.pub | ssh user@domain.tld 'cat >> .ssh/authorized_keys'
ssh-keygen -d
ssh -l username -L 4444:alpha.hostname.com:80 dmz.hostname.com
# For TextDrive accounts (running mutt on the server) set mbox_type=Maildir set folder="~/Maildir/" set spoolfile="~/Maildir/" set mask="!^\\.[^.]" set record="+.Sent" set postponed="+.Drafts" set realname="Yourname" mailboxes `\ echo -n "+ "; \ for file in ~/Maildir/.*; do \ box=$(basename $file); \ if [ ! $box = '.' -a ! $box = '..' -a ! $box = '.customflags' \ -a ! $box = '.subscriptions' ]; then \ echo -n "+$box "; \ fi; \ done` macro index c "? " "open a different folder" macro pager c "? " "open a different folder" set allow_8bit # Don't do any Quoted-Printable encoding on 8-bit data! set copy=yes # Ask me if I want to save a copy of my outgoing messages. set delete=yes set noaskcc set nomark_old set reverse_alias set reverse_name set reply_to set attribution="On %d, %n wrote:" set envelope_from set noconfirmappend set print=ask-no set print_cmd="echo Nix printi printi!" set nosave_empty set sort=threads set read_inc=10 set write_inc=10 set noprompt_after set status_format="%r %v [%?M?%M/?%m] %?n?%n new, ?%?p?%p postponed, ?%?t?%t +tagged, ?%?d?%d delet ed, ?(%h:%f) %?b?%b more to go.?%> %r" #set alias_file="~/.aliases" set quote_regexp="^([A-Za-z ]+>|[]>:|}-][]>:|}-]*)" set include set hdr_format="%4C %Z %{%b %d} %-15.15n (%4l) %s" set nomove set tilde set noautoedit set pager_context=1 set pager_stop set pipe_decode set postponed="+postponed" set to_chars="b .c>" set fast_reply color header brightcyan black . color header yellow black Subject: color body brightyellow black [_a-z\.\$A-Z0-9-]+@[a-zA-Z0-9\./\-]+ color body yellow black (http|ftp)://[_a-zA-Z0-9\./~\-]+ color quoted green black color signature brightblue black color attachment yellow black color tree red black color indicator black cyan color status yellow blue color tilde blue black bind pager 'w' previous-page bind pager 'j' next-line bind pager 'k' previous-line bind index '#' tag-entry bind index '{' previous-thread bind index '}' next-thread # Headers to ignore ignore * unignore date from to cc subject x-mailer resent-from reply-to
#!/bin/bash ## USAGE: add_to_server.sh remote_server ## This script will add your ssh dsa public key to remote_server's authorized_keys list, ## assuming that everything is in it's default location set -v # verbose output username="USERNAME" # CHANGE ME!!!! remote_server=$1 # assigns the first commandline argument to $remote_server ## Pipe the public key to ssh, then remotely touch the file to make sure it will be there, and concat to the end of it. ## Might work without the touch? cat ~/.ssh/id_dsa.pub | ssh ${username}@${remote_server} "touch ~/.ssh/authorized_keys && cat - >> ~/.ssh/authorized_keys" exit 0
http://savannah.gnu.org/projects/tramp/
cd ~/.emacs.d/ tar -xvzf /your/download/folder/tramp-2.X.X.tar.gz ln -s tramp-2.X.X tramp cd tramp ./configure --with-contrib make sudo make install
;; Remote file editing via ssh (add-to-list 'load-path "~/.emacs.d/tramp/lisp/") (require 'tramp) (setq tramp-default-method "ssh")
#For Darwinports ln -s /opt/local/bin/sv* /usr/bin/ #For Fink ln -s /sw/bin/sv* /usr/bin/
export CVS_RSH="ssh" export CVSROOT=":ext:me@someserver:/path/to/repository"
osascript -e 'set volume output muted true'
rar a FileName.rar
rar a FileName.rar originalfilename.whatever
rar a -v#### FileName.rar originalfilename.whatever
for files in /usr/local/apache/domlogs/*; do grep "wget" $files; done;
cd /usr/local/apache/domlogs grep wget * grep lynx * grep curl *
grep wget a* grep wget b* grep wget c* grep wget d* grep wget e* grep wget f* grep wget g* grep wget h* grep wget i* grep wget j* grep wget k* grep wget l* grep wget m* grep wget n* grep wget o* grep wget p* grep wget q* grep wget r* grep wget s* grep wget t* grep wget v* grep wget w* grep wget x* grep wget y* grep wget z*
for i in `ls /usr/local/apache/domlogs|grep -v 'bytes_log'`; do echo "checking on $i" && grep wget /usr/local/apache/domlogs/$i && grep lynx /usr/local/apache/domlogs/$i && grep curl /usr/local/apache/domlogs/$i; done > /root/grep-domlogs-results.txt Then simply take a look at this file /root/grep-domlogs-results.txt
grep "dictionary attack" /var/log/exim_mainlog
top -d2 netstat -nap | grep SYN | wc -l netstat -nap | less
iptables -A INPUT -s ip.address -j DROP
cd /dev/shm ls
locate bindz locate botnet.txt locate dc locate ex0.pl locate kaiten locate r0nin locate udp.pl locate ... lsof | grep ., locate mybot
iptables -A INPUT -s ip.address -j DROP
tail -200 /var/log/exim_mainlog tail -200 /usr/local/apache/logs/error_log
tail -f /var/log/messages
sudo sysctl -w kern.maxfiles=22000 sudo sysctl -w kern.maxfilesperproc=20000
ssh username@servername.textdrive.com
mkdir ~/apps/ (or whatever you want to name it)
cd ~/apps/
Example: svn checkout svn://leetsoft.com/typo/trunk typo
Example: cd typo
#!/usr/local/bin/ruby18
mysql -u username -p
create database textdriveusername_appname;
exit;
mysql -u username -p textdriveusername_appname < db/schema.mysql.sql
ln -s /home/username/apps/appname/public /home/username/public_html/appname
/usr/local/sbin/lighttpd -f /home/username/lighttpd/lighttpd.conf
killall -9 -u your_username lighttpd killall -9 -u your_username ruby18
ps aux
kill -9 pid (replacing pid with the PID you found)