Coders knew Vim for the last twenty years for its unmatched efficiency in editing source code. Vim wasn’ t too popular in the Rails community until lately when Tim Pope published his plug-in: Rails.vim. This plug-in and Vims legendary extendibility made it the editor of choice of many programmers who used some proprietary applications in the past. The plug-in offers shortcuts for easy navigation between files, makes it possible to run scripts, generate controllers, views, do some refactoring, and do auto completion , all of these from Vims cosy interface. Some people say that it is the least user friendly text editor ever. While these accusations might be partly true, because of the rather steep learning curve, many programmers just liked the way Vim helped them do their work quickly and efficiently.
Enough said lets see how to create a very simple blog in Rails from Vim. [Read more…]
Useful basic commands for Networking
Tools and network performance analysis
ifconfig
ifconfig [down|delete]
ethereal to launch ethereal
tcpdump –i tool to capture and analyze packets
netstat –w [seconds] –I [interface] display network settings and statistics
udpmt –p [port] –s [bytes] target_host it creates UDP traffic
udptarget –p [port] it’s able to receive UDP traffic
tcpmt –p [port] –s [bytes] target_host it creates TCP traffic
tcptarget –p [port] it’s able to receive TCP traffic
ARP, switching and VLANs
arp –a it shows the current ARP table
arp –s to add an entry in the table
arp –a –d to delete all the entries in the ARP table
telnet 192.168.0.254 to access the switch from a host in its subnetwork
sh ru or show running-configuration to see the current configurations
configure terminal to enter in configuration mode
exit in order to go to the lower configuration mode
vlan n it creates a VLAN with ID n
no vlan N it deletes the VLAN with ID N
untagged Y it adds the port Y to the VLAN N
ifconfig vlan0 create it creates vlan0 interface
ifconfig vlan0 vlan ID vlandev em0 it associates vlan0 interface on top of em0, and set the tags to ID
ifconfig vlan0
to turn on the virtual interface
tagged Y it adds to the port Y the support of tagged frames for the current VLAN
Routing
netstat –rnf inet it displays the routing tables of IPv4
sysctl net.inet.ip.forwarding=1 to enable packets forwarding (to turn a host into a router)
route add|delete [-net|-host] (ex. route add .0/24 .4) to add a route
route flush it removes all the routes
route add -net 0.0.0.0 .2 to add a default route
routed -Pripv2 –Pno_rdisc –d [-s|-q] to execute routed daemon with RIPv2 protocol, without ICMP auto-discovery, in foreground, in supply or in quiet mode
route add 224.0.0.0/4 127.0.0.1 it defines the route used from RIPv2
rtquery –n to query the RIP daemon on a specific host (manually update the routing table)
UDP/TCP
socklab udp it executes socklab with udp protocol
sock it creates a udp socket, it’s equivalent to type sock udp and bind
sendto emission of data packets
recvfrom it receives data from socket
socklab tcp it executes socklab with tcp protocol
passive it create a socket in passive mode, it’s equivalent to sock tcp, bind, listen
accept it accepts an incoming connection (it can be done before or after creating the incoming connection)
active it create a socket in active mode
connect
close it closes the connection
read
write (ex. write ciao, ex. write #10) to write “ciao” or to write 10 bytes on the socket
NAT/Firewall
ipnat –f file_name it writes filtering rules into file_name
ipnat –l it gives the list of active rules
ipnat –C –F it re-initialize the rules table
map em0 192.168.1.0/24 -> .57/32 portmap tcp/udp 20000:50000
ipf –f file_name it writes filtering rules into file_name
ipf –F –a it resets the rule table
ipmon log_file in proto icmp all it allows to display the specified traffic
ipfstat –I it grants access to a few information on filtered packets, as well as active filtering rules
[block/pass] [in/out] proto [icmp/tcp/udp] from [any/192.168.0.1/24] port=22 to [any/192.168.1.1/24] port=80
If You want a pdf version: basic unix networking commands
For more commands do check here: http://computerandu.wordpress.com/2010/12/26/basic-networking-commands-in-unix/
Courtesy: Jianning Zhang
How to find saved passwords in Firefox or Google Chrome?
For the ease of using internet on a personal computer we often save our passwords in the web browser (Remember the pop up with “save the password”, “not now”, “never for this site”). It saves you from the pain of entering the passwords in the websites. Do you know these saved passwords can be easily viewed by any person using the computer. Your passwords are not safe in the case if people have access to your computer.
You can also use the same for hacking some friend’s passwords if you have physical access to his system.
Its not rocket science. Its very simple. You might also knew it before hand. In case you don’t follow the steps:
1. Mozilla Firfox:
- Open the Firefox.
- Click on “Tools” on the top of the browser
- Choose “Options”
- Choose “Security” tab
- Click on “Saved passwords”
- Here you can see various websites and the username stored on it
- Select any of them and click “Show password”
- There it is, right in front of you.
2. Google Chrome:
In Google Chrome, go to settings (the wrench symbol on the top right corner). Choose options. Go to “Personal Stuff” tab and select “show saved passwords”.
Basic Networking Commands in Unix
I would like to discuss the basic Unix commands useful for networking:
Network interfaces commands:
- ifconfig –a —- Show all interfaces
- ifconfig ——shows the configuration (like IP, MAC, SubNet, IPV6) of a particular interface
- ifconfig —–Set parameters of the interface (Root only) You can set various parameters like IP address, subnet,
- ifconfig —– that particular interface is Up (activated) or down (deactivated)
Connectivity:
-
ping
—- sends an ICMP echo message (one packet) to a host. This may go continually until you hit Control-C. Ping means a packet was sent from your machine via ICMP, and echoed at the IP level. ping tells you if the other Host is Up. -
telnet host
—- talk to “hosts” at the given port number. By default, the telnet port is port 23. Few other famous ports are: 7 – echo port, use control-] to get out
25 – SMTP, use to send mail
79 – Finger, provides information on other users of the network
Arp:
- arp –a —- Print the arp table. Arp is used to translate IP addresses into Ethernet addresses. Root can add and delete arp entries. Deleting them can be useful if an arp entry is malformed or just wrong. Arp entries explicitly added by root are permanent — they can also be by proxy. The arp table is stored in the kernel and manipulated dynamically. Arp entries are cached and will time out and are deleted normally in 20 minutes
Routing:
- netstat –r —- Print routing tables. The routing tables are stored in the kernel and used by ip to route packets to non-local networks.
- route add —- The route command is used for setting a static (non-dynamic by hand route) route path in the route tables. All the traffic from this PC to that IP/SubNet will go through the given Gateway IP. It can also be used for setting a default route; i.e., send all packets to a particular gateway, by using 0.0.0.0 in the pace of IP/SubNet.
- routed —– The BSD daemon that does dynamic routing. Started at boot. This runs the RIP routing protocol. ROOT ONLY. You won’t be able to run this without root access.
- gated —– Gated is an alternative routing daemon to RIP. It uses the OSPF, EGP, and RIP protocols in one place. ROOT ONLY.
- traceroute —- Useful for tracing route of IP packets. The packet causes message to be sent back from all gateways in between the source and destination by increasing the number of hopes by 1 each time.
Others:
- nslookup —- Makes queries to the DNS server to translate IP to a name, or vice versa. eg. nslookup facebook.com will gives you the IP of facebook.com
-
ftp
—– Transfer files to host. Often can use login=“anonymous” , p/w=“guest” - rlogin -l —– Logs into the host with a virtual terminal like telnet
Important Files:
- /etc/hosts —- names to ip addresses
- /etc/networks —- network names to ip addresses
- /etc/protocols —– protocol names to protocol numbers
- /etc/services —- tcp/udp service names to port numbers
Courtsey: Prof. Andrej Duda, Wikipedia, math.uaa.alaska.edu