? Earlier 27 items total Later ?

On this page:?

Accessing CVS on a remote server through SSH

If the repository is on a remote server and you have SSH access, then just set CVS_RSH and CVSROOT.

For example, in bash:

export CVS_RSH="ssh"
export CVSROOT=":ext:me@someserver:/path/to/repository"


In combination with ssh-agent, this works nicely.

Mute Remote Macintosh

Sometimes I am in bed and too lazy to get out to mute my G5. I can just grab my iBook, SSH into the G5 and run the following command:

osascript -e 'set volume output muted true'


brilliant!

RARing files on Mac OSX 10.4

1) Download the application called RAR at

http://files3.rarlab.com/rar/rarosx-3.5.1.tar.gz

2) decompress that file and there'll be a folder called "rar".

3) in that folder there's a file called "rar" (with no quotes or extension)

4) In Finder, go to Go > Go To Folder, and type in "/bin".

5) drag the FILE called "rar" in to that bin folder. It will ask you for your password, so go type it in and continue.

6) open the terminal and go to the directory that has the file or files you want to rar.

7A) once in the folder housing the files you want to rar, type this:

rar a FileName.rar


7B) Alternatively, you can specify which file or folder inside the folder you're in, you want to rar:

rar a FileName.rar originalfilename.whatever


8) to make a multi file rar archive, type the following instead of the above and replace where you see "####" with the file size you want each part to be, in kilobytes (kb).

rar a -v#### FileName.rar originalfilename.whatever


Search for terms in Domlogs

for files in /usr/local/apache/domlogs/*; do grep "wget" $files; done;


-OR-

cd /usr/local/apache/domlogs
grep wget *
grep lynx *
grep curl *


Replace wget with other file names/terms you might want to search for.

If that takes too long, try doing it one by one:

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*


Alternatively, if you get an error like "Argument list too long":

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

Looking up recent dictionary attacks

grep "dictionary attack" /var/log/exim_mainlog

Looking into DOS and DDOS Attacks

http://etechsupport.net/forum/showthread.php?t=434

top -d2
netstat -nap | grep SYN | wc -l
netstat -nap | less


If there are many httpd processes showing up after step 1, you might be under attack. If you get high numbers for the second one, you are almost definitely under attack. Use the third one to see the IP addresses, and then ban them from the server:

iptables -A INPUT -s ip.address -j DROP


Also try the following for fixing stuff:
cd /dev/shm
ls


And delete anything that's not supposed to be there.

locate bindz
locate botnet.txt
locate dc
locate ex0.pl
locate kaiten
locate r0nin
locate udp.pl
locate ...
lsof | grep .,
locate mybot

Ban IPs from a server

iptables -A INPUT -s ip.address -j DROP

How to tail logs

tail -200 /var/log/exim_mainlog
tail -200 /usr/local/apache/logs/error_log


To watch the log get updated in real time:
tail -f /var/log/messages 

Sims 2 File Limit Fix

sudo sysctl -w kern.maxfiles=22000
sudo sysctl -w kern.maxfilesperproc=20000


Type this into Terminal in Mac OSX to fix the file size limit for The Sims 2, allowing you to have more than 5000 downloads.

Add a New Rails App (Textdrive & Lighttpd)

Based on: http://forum.textdrive.com/viewtopic.php?id=5094

Get Lighttpd working on Textdrive first (http://manuals.textdrive.com/read/book/9), then to add new Rails apps (ex: typo.domain.tld) follow the steps below...

1. ssh into your account
ssh [email protected]


2. Create a new directory for your rails apps (if you don't have one already):
mkdir ~/apps/ (or whatever you want to name it)


3. Move into that directory:
cd ~/apps/


4. svn checkout the app you want:
Example:
svn checkout svn://leetsoft.com/typo/trunk typo


5. Move into that new app's directory:
Example:
cd typo


6. Change the first line of appname/public/dispatch.rb and appname/public/dispatch.fcgi to:
#!/usr/local/bin/ruby18


7. Set-up MySQL database:

a.
mysql -u username -p

b.
create database textdriveusername_appname;

c.
exit;

d.
mysql -u username -p textdriveusername_appname < db/schema.mysql.sql


8. Create a symbolic link to your app's public folder, inside of your public_html folder:
ln -s /home/username/apps/appname/public /home/username/public_html/appname


9. Add an $HTTP["host"] entry into your lighttpd.conf for the new app (ex: http://textsnippets.com/posts/show/6 and http://textsnippets.com/posts/show/187)

10. Kill all your dispatch.fcgi processes and your lighttpd process (ex: ttp://textsnippets.com/posts/show/206)

11. Restart lighttpd:
/usr/local/sbin/lighttpd -f /home/username/lighttpd/lighttpd.conf


12. Navigate to http://appname.yourdomain.tld


? Earlier 27 items total Later ?