activate root in ubuntu after install
sudo passwd root
2818 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!)
sudo passwd root
crontab -e
#alter the regex to suit your needs, each () will return a submatch my $regex = qr!(\d\d)[-](\d\d)[-](\d\d)[_](\d\d\d\d)!; while(<*.jpg>) { $oldname = $_; if ($oldname=~m/$regex/) { #$1,$2,etc are submatchs rename $oldname,$3.$2.$1.$4.".jpg"; } }
<IfModule mod_rewrite.c> RewriteRule ^(.*/)?\.svn/ - [F,L] ErrorDocument 403 "Access Forbidden" IfModule>
# 1) make yrself a user and stop being root # 2) main web stack + ruby sudo aptitude install -y make screen sudo aptitude install -y apache2 php5 mysql-server sudo aptitude install -y subversion postfix sudo aptitude install -y ruby1.8 ruby1.8-dev rubygems irb sudo aptitude install -y imagemagick librmagick-ruby1.8 librmagick-ruby-doc libfreetype6-dev xml-core # 3) gemz # rubygems appears to be broken as hell. # gem update --system does squat # had to manually d/l rubygems 1.0.1, ruby setup.rb wget http://rubyforge.org/frs/download.php/29548/rubygems-1.0.1.tgz tar xzvf rubygems-1.0.1.tgz cd rubygems-1.0.1 sudo ruby setup.rb sudo gem install rails mongrel merb map_by_method
[myshare] path = /var/test veto files = /var/test/private
rar a -m5 -R output.rar /etc/
desktop ~ # screen -S clfs desktop ~ # chroot "${CLFS}" /tools/bin/env -i \ > HOME=/root TERM="${TERM}" PS1='\u:\w\$ ' \ > PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin \ > /tools/bin/bash --login +h root:/#
sudo aptitude install smbfs sudo mkdir /media/sharename sudo vim /etc/nsswitch.conf
hosts: files dns
hosts: files wins dns
sudo aptitude install winbind
sudo mount -t cifs //MyBookWorld/PUBLIC /media/shares/MyBook/PUBLIC -o username= "vasil",password="MyPassword",iocharset=utf8,uid=vasil,guid=vasil,rw,noperm
grep -r "redeem reward" /home/tom
ls -lh df -h
postsuper -d ALL deferred
$ iwlist scan $ iwconfig eth1 ESSID <MY_ESSID> mode Managed channel <MY_CHANNEL>
shutdown -rf +1 "Scheduled test of system reboot"
# In the following example, we create a dynamic # forward from port 8080 (client) to port 22 (host.net). ssh -D 8080 username@host.net # Now, we'll check out netstat to see what we # have done. netstat # Active Internet connections (w/o servers) # ... # tcp 0 0 host.net:ssh client.com:60565 ESTABLISHED # ... # # Awesome! Now we've got the connection. I'll add # another post telling how to use this port as a # socks proxy for any TCP application :)
echo "database backup for 070614" | mutt -s "backup: myerasmus_db_070614" -a erasmus_db_070614.sql.bz2.gpg [email address]
gpg -e -r Bob file
gpg --output <filename> -d [file]
ssh-keygen -t rsa
sftp root@<server address> lcd /home/<your login>/.ssh put id_rsa.pub
ssh root@<server address> cd .ssh cat id_rsa.pub >> authorized_keys
RSAAuthentication yes PubkeyAuthentication yes
/etc/init.d/ssh reload
ssh -v root@<server address>
sudo ln -s /usr/local/sbin/apachectl /etc/init.d/apache2 sudo chmod +x /etc/init.d/apache2
sysv-rc-conf
postfix reload