Archive for the ‘FOSS’ Category

Browsing the Internet with SSH tunneling

Tuesday, March 16th, 2010

On your server:
1. Just create an SSH account.

On your client (Linux/Mac):
1. Open a terminal and key in the following,
#ssh -fND 8080 username@remoteserver.net

2. Open Firefox and go to Preferences -> Advanced -> Network -> Proxy Settings and choose “Manual proxy configuration.”

3. Put “127.0.0.1″ for the SOCKS host field and “8080″ on the corresponding port field.

4. You can now start browsing.

Optional:

5. If you want to use the DNS server of the SSH server, open Firefox and key in “about:config” at the address bar.

6. Look for “network.proxy.socks_remote_dns.” Double-click it to change the value from “false” to “true”.

7. You can now start browsing!

  • Share/Bookmark

Installing and Running RubyOnRails on Ubuntu

Thursday, December 10th, 2009

sudo apt-get install ruby-full build-essential

or

sudo aptitude install ruby build-essential libopenssl-ruby ruby1.8-dev

sudo apt-get install rubygems

echo “export PATH=/var/lib/gems/1.8/bin:$PATH” >> ~/.bashrc

sudo gem update –system

INSTALLING Rails

sudo gem install rails

or

apt-get install rails (installing rails with gem is preferred)

sudo aptitude install libfcgi-dev

RUNNING RubyOnRails

rails /home/myuser/www/mynewapp -d mysql (-D if you installed rails with apt)

$cd /home/myuser/www/mynewapp
$ruby script/server

  • Share/Bookmark

Hardening TPC/IP in linux

Friday, November 20th, 2009

Execute the following:

sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1
sysctl -w net.ipv4.conf.all.accept_redirects=0
sysctl -w net.ipv6.conf.all.accept_redirects=0
sysctl -w net.ipv4.conf.all.send_redirects=0
sysctl -w net.ipv6.conf.all.send_redirects=0
sysctl -w net.ipv4.conf.all.accept_source_route=0
sysctl -w net.ipv4.conf.all.forwarding=0
sysctl -w net.ipv4.conf.all.rp_filter=1
sysctl -w net.ipv4.tcp_max_syn_backlog=1280
sysctl -w net.ipv4.tcp_syncookies=1
sysctl -w net.ipv4.conf.all.log_martians=1
sysctl -w net.ipv4.conf.all.mc_forwarding=0

To make it permanent, put the same line above minus the “sysctl -w ” command  in /etc/sysctl.conf

net.ipv4.icmp_echo_ignore_broadcasts=1
net.ipv4.conf.all.accept_source_route=0
net.ipv4.conf.all.mc_forwarding=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_max_syn_backlog=1280
net.ipv4.tcp_syncookies=1
net.ipv4.conf.all.accept_redirects=0
net.ipv6.conf.all.accept_redirects=0
net.ipv4.conf.all.send_redirects=0

  • Share/Bookmark

Useful commands for displaying Network Services/Connections

Friday, November 20th, 2009

#netstat -an|awk ‘/tcp/ {print $6}’|sort| uniq -c

#netstat -anp

#lsof|grep LISTEN

  • Share/Bookmark

Change WordPress URL via MySQL

Wednesday, June 24th, 2009

UPDATE wp_options SET option_value = replace(option_value, ‘http://localhost/mis’, ‘http://www.ubaguio.edu/mis’) WHERE option_name = ‘home’ OR option_name = ‘siteurl’;

  • Share/Bookmark

Automatically deny hosts from SSH brute force attacks

Friday, August 15th, 2008

1. Download denyhosts from:

http://denyhosts.sourceforge.net/

2. Extract file and follow README.txt

  • Share/Bookmark

Installing dkfilter

Wednesday, June 11th, 2008

Check http://jason.long.name/dkfilter/ before proceeding with installation.

1. Problems installing Crypt::OpenSSL::RSA
——————————————
install Crypt::OpenSSL::Bignum
install Crypt::RSA ? *irrelevant
install OpenSSL::RSAkey ?
Solved: Just install via rpm from dag http://dag.wieers.com/rpm/packages/perl-Crypt-OpenSSL-RSA/

2. Mail::Address OK

3. MIME::Base64 OK

4. Problems installing Net::DNS
—————————————–
install Test::Pod
Digest::BubbleBabble
Solved: Change NS to to your local forwarded not opendns.

  • Share/Bookmark

Postfix+MailScanner+Spamassassin

Wednesday, June 11th, 2008

1. Install Postfix
2. Download and Install MailScanner
3. Install Spamassassin

4. /etc/postfix/main.cf
header_checks = regexp:/etc/postfix/header_checks

5. /etc/postfix/header_checks
/^Received:/ HOLD

6. /etc/MailScanner/MailScanner.conf
Run As User = postfix
Run As Group = postfix
Incoming Queue Dir = /var/spool/postfix/hold
Outgoing Queue Dir = /var/spool/postfix/incoming
MTA = postfix

7. #chown postfix.postfix /var/spool/MailScanner/incoming

8. #chown postfix.postfix /var/spool/MailScanner/quarantine

9. mkdir /var/spool/MailScanner/spamassassin

  • Share/Bookmark

CheckInstall

Wednesday, June 11th, 2008

CheckInstall keeps track of all files installed by a “make install” or equivalent, creates a Slackware, RPM, or Debian package with those files, and adds it to the installed packages database, allowing for easy package removal or distribution.

http://freshmeat.net/projects/checkinstall

  • Share/Bookmark