Tuesday, July 27, 2010

vim stuff

Try these examples:

  • Enter :help to browse help. Scroll down the help page to see the quickref and tutor links, and the table of contents.
  • Enter :help pattern for help on the topic pattern (for example).
  • :h pattern is the same (the :help command can be abbreviated).

Command completion can be used when entering a help topic:

  • Type :h patt then press Ctrl-D to list all topics that contain "patt".
  • Type :h patt then press Tab to scroll through the topics that start with "patt".
  • If you have set the 'wildmenu' option (e.g. by using :set wildmenu), then :h patt followed by opens a menu on the statusline, with all help topics containing "patt". You can select any item in the menu with the arrow keys or more presses of the key to fill in the rest of your command line.

Links:

  • Enter :h to open the main help page.
  • Type /quick to search for "quick" (should find the quickref link).
  • Press Ctrl-] to follow the link (jump to the quickref topic).
  • After browsing the quickref topic, press Ctrl-T to go back to the previous topic.
  • You can also press Ctrl-O to jump to older locations, or Ctrl-I to jump to newer locations.

Searching:

  • Search within a help file using / like you would when searching any file.
  • Search all the help files with the :helpgrep command, for example:
:helpgrep \csearch.\{,12}file
\c means the pattern is case insensitive.
The pattern finds "search" then up to 12 characters followed by "file".
You will then see the first match. To see other matches for the same pattern, use:
:cnext
:cprev
:cnfile
:cpfile
:cfirst
:clast
and even
:cc
which brings you back to the current match after you scrolled the helpfile, or
:copen
which will list out all the matches in a separate window. Read up on these commands with the :help entry for each of them!

Each week (or more often if you prefer), read a new section from the :help page to learn something new!

irc stuff

  • Irssi - Popular command line/text based IRC client.

  • WeeChat - Another popular command line/text based IRC client.

  • Pidgin another multiple protocol with gui

irc.freenode.net
fishcooker
/msg NickServ identify

via web
http://webchat.freenode.net/#
http://mibbit.com/

apt.conf

ACQUIRE {
http::proxy "http://localhost:22222/"
}

APT::Get::AutomaticRemove "true";
APT::Install-Recommends "false";
APT::Get::force-yes "true";
APT::Get::Assume-Yes "true";

deb http://10.151.35.203/lucid lucid main restricted universe multiverse
deb http://10.151.35.203/lucid lucid-updates main restricted universe multiverse
deb http://10.151.35.203/lucid lucid-security main restricted universe multiverse
deb http://10.151.35.203/lucid lucid-backports main restricted universe multiverse
deb http://10.151.35.203/lucid lucid-proposed main restricted universe multiverse

tunneling ssh dynamic

ssh -p source_port -D local_dynamic_port -f -N username@ip_remote_host
ssh -f -N -L local_dynamic_port:localhost:source_port username@ip_remote_host

Friday, July 23, 2010

make BIND9 work

root@earth:/etc/bind# cat /etc/bind/named.conf.local
//
// Do any local configuration here
//

// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone "gridgalaxy.org" {
type master;
file "/etc/bind/zones/gridgalaxy.org.zone";
};

zone "35.151.10.in-addr.arpa" {
type master;
file "/etc/bind/zones/rev.35.151.10.in-addr.arpa";
};
root@earth:/etc/bind# cat /etc/bind/zones/gridgalaxy.org.zone
gridgalaxy.org. IN SOA ns1.gridgalaxy.org. admin.gridgalaxy.org. (
2006071801
28800
3600
604800
38400 )
gridgalaxy.org. IN NS ns1.gridgalaxy.org.
gridgalaxy.org. IN MX 10 mta.gridgalaxy.org.

www IN A 10.151.35.203
mta IN A 10.151.35.203
ns1 IN A 10.151.35.203
earth IN A 10.151.35.203
saturn IN A 10.151.35.203

root@earth:/etc/bind# cat /etc/bind/zones/rev.35.151.10.in-addr.arpa
@ IN SOA ns1.gridgalaxy.org. admin.gridgalaxy.org. (
2006071801; serial
28800; refresh, seconds
604800; retry, seconds
604800; expire, seconds
86400 ); minimum, seconds

IN NS ns1.gridgalaxy.org.

203 IN PTR gridgalaxy.org

root@earth:/etc/bind# cat /etc/resolv.conf
nameserver 10.151.35.203
nameserver 202.46.129.2

root@earth:/etc/bind# /etc/init.d/bind9 restart

root@earth:/etc/bind# nslookup saturn.gridgalaxy.org
Server: 10.151.35.203
Address: 10.151.35.203#53

Name: saturn.gridgalaxy.org
Address: 10.151.35.203

root@earth:/etc/bind# nslookup google.com
Server: 202.46.129.2
Address: 202.46.129.2#53

Non-authoritative answer:
Name: google.com
Address: 72.14.254.104

debmirroring

+++++++++++++++++++++++++++++++++++
DISTS="hardy,hardy-backports,hardy-security,hardy-updates"
SECTION="main,multiverse,restricted,universe"
ARCH="i386"
debmirror --ignore-release-gpg --verbose --method=ftp --host=mirror.its.ac.id \
--dist=$DISTS --section=$SECTION \
--arch=$ARCH --nosource --root=ubuntu \
--diff=mirror --ignore-small-errors /hardy
+++++++++++++++++++++++++++++++++++

DISTS="lucid,lucid-backports,lucid-security,lucid-updates"
SECTION="main,multiverse,restricted,universe"
ARCH="i386"
debmirror --verbose --method=http --host=kambing.ui.ac.id --dist=$DISTS --section=$SECTION --arch=$ARCH --nosource --root=ubuntu --ignore-release-gpg /home/globus/mnt/3/lucid
+++++++++++++++++++++++++++++++++++

save one of those on the file then execute it

passwordless ssh login

globus@saturn:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/globus/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/globus/.ssh/id_rsa.
Your public key has been saved in /home/globus/.ssh/id_rsa.pub.
The key fingerprint is:
86:2b:cd:71:7b:9f:63:68:39:38:b8:6b:8d:b0:20:57 globus@saturn
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| E . |
| . o S |
|. o .o = . |
| o ..o++...o |
| ..+ +.=.o. |
| .oo o oo. |
+-----------------+

globus@saturn:~$ scp /home/globus/.ssh/id_rsa.pub globus@10.151.35.203:/home/globus/.ssh/authorized_keys
globus@10.151.35.203's password:
id_rsa.pub 100% 395 0.4KB/s 00:00

globus@saturn:~$ ssh 10.151.35.203
Linux earth 2.6.32-23-generic-pae #37-Ubuntu SMP Fri Jun 11 09:26:55 UTC 2010 i686 GNU/Linux
Ubuntu 10.04 LTS

Welcome to Ubuntu!
* Documentation: https://help.ubuntu.com/

System information as of Fri Jul 23 05:54:00 EDT 2010

System load: 0.14 Swap usage: 0% Users logged in: 1
Usage of /home: 4.4% of 35.77GB Temperature: 40 C
Memory usage: 4% Processes: 99

Graph this data and manage this system at https://landscape.canonical.com/

Last login: F
Publish Post
ri Jul 23 05:27:08 2010
globus@earth:~$
[yip2 it works, do it vice versa]