1. See commits git log 2. setup vimdiff as default diff tool for git git config --global diff.tool vimdiff 3. disable question prompt for vimdiff git config --global diff.tool.prompt false 4. See diff between commits git difftool <commit-sha> -- <file-path>
Ubuntu wireless configuration from command line
Generate passphrase: wpa_passphrase <myssid> <mypassword> > /etc/wpa_supplicant.conf Edit /etc/network/interfaces: auto <wireless-interface> iface <wireless-interface> inet static address 10.1.1.10 netmask 255.255.255.0 wireless-essid <myssid> gateway 10.1.1.1 post-up wpa_supplicant wpa_supplicant -B -Dnl80211 -i<wireless-interface> -c/etc/wpa_supplicant.conf post-down killall -q wpa_supplicant dns-nameservers 8.8.8.8 Here you need to find out your wifi adapter's driver using wpa_supplicant --help. In my case it is nl80211 … Continue reading Ubuntu wireless configuration from command line
SSH to a Host With Multiple Hops
If you want to make an SSH connection to a host which is reachable only with multiple ssh connections you may use below command to connect it easly. (Note that older versions of ssh do not have this option but you can use some workarounds to do the same (proxy command and etc.)) Assume that … Continue reading SSH to a Host With Multiple Hops
Ubuntu static IP configuration
auto eth0 iface eth0 inet static address 192.168.0.101 gateway 192.168.0.1 netmask 255.255.255.0 dns–nameservers 8.8.8.8 8.8.4.4
Bring interface up without ip address at boot
Edit /etc/network/interfaces and add following: auto <interface_name> iface<interface_name> inet manual up ifconfig <interface_name> up
Openvswitch Cheat Sheet
Add libvirt network to be used with open vswitch Create an xml file like below (it is going to be listed in networks) <network> <name>obr0</name> <forward mode='bridge'/> <bridge name='obr0'/> <virtualport type='openvswitch'/> </network> The name of the network The forward mode is set to bridge The bridge name is the bridge name The virtualport is set to openvswitch Then introduce this network to … Continue reading Openvswitch Cheat Sheet
Nagios Tutorial for Programmers – 1
If you're reading this post, then you probably know what Nagios is. It is a good, open-source monitoring solution for most of the needs. Most of the Nagios concept is very straight-forward for system admins. But if you're rather a programmer then a system administrator some of Nagios concepts may confuse you. You have already … Continue reading Nagios Tutorial for Programmers – 1
Debian Bring Manually Configured Interface Up at Boot/Reboot
Edit /etc/network/interfaces and make following changes: 1.Add interface to auto line (your interface name may change and number of interfaces may also change). This change makes interface to be brought up at boot time: auto lo eth0 eth1 eth2 2.Add following lines for each interface. This change will make interface to be manually configured: iface … Continue reading Debian Bring Manually Configured Interface Up at Boot/Reboot
KVM Persistent Interface Names
If you're using KVM for virtualization you may notice that your ethernet device that is attached to the bridge may have different names each time KVM restarts, and KVM manages attaching/detaching this interface to the bridge by itself. If you're using standard linux bridge you can check attached ports: brctl show This gives you current … Continue reading KVM Persistent Interface Names
Autostart KVM Guest on System Boot
If you want your virtual machine to start when host starts, there are two ways to do this. First one uses command line and pretty straightforward. Second one uses virt-manager (a GUI to manage kvm guests) Command line: virsh autostart <domain> Replace domain with your virtual machine name (case sensitive). For instance, if you have … Continue reading Autostart KVM Guest on System Boot