Here is some info on vim that I put here mainly for my reference. Maybe someone else will find them useful.
Color schemes
Set the color scheme in .vimrc, e.g. add a line like "colorscheme ron"
In vim, you can list the color schemes with ":colo <TAB>" (space after "colo")
If no colors after setting the color scheme, make sure syntax is enabled. In .vimrc add the line "syntax on".
Editing Multiple Files
:ls - List open files
:n or :bn - Go to next file
:p or :bp - Go to previous file
:b10 - Go to 10th file
:b foo - Go to file named "foo"
:b <TAB-KEY> - Cycle through open files (space after ":b")
CTRL-w v - Split screen vertically
CTRL-w s - Split screen horizontally
CTRL-w h and CTRL-w l - Switch through vertical windows
CTRL-w k and CTRL-w j - Switch through horizontal windows
Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts
Thursday, November 7, 2013
Monday, August 19, 2013
Disable the Touchpad and Trackpoint Pointer in Linux
The mouse pointer on my Arch Linux system was going crazy. It was drifting badly and my mouse was unusable most of the time. Very frustrating. I thought I narrowed the problem down to a hardware issue on the touchpad. I have a USB mouse, so I don't really need the touchpad. I came across this script to toggle the touchpad on and off.
#!/bin/bash synclient TouchpadOff=$(synclient -l | grep -c 'TouchpadOff.*=.*0')This does indeed toggle the touchpad, but my problem still remained. So, the touchpad wasn't the problem. Then I saw the Trackpoint pointer sitting in the middle of my keyboard (otherwise known as an eraser pointer or the colorfully nicknamed clit mouse). So I dug around and found I could disable it easily enough. First, get the name of the device by running:
xinputIn my case the name is "TPPS/2 IBM TrackPoint". Then disable it with this:
xinput set-prop "TPPS/2 IBM TrackPoint" "Device Enabled" 0Problem solved. Hopefully someone else will find this useful.
Tuesday, August 13, 2013
Setting up a Gogo6 / Freenet6 IPv6 tunnel in Linux
It's 2013....where's my IPV6? IPv6 was introduced to alleviate some of the problems with IPv4. It's been available for well over 10 years, but the internet is slow to adopt the new format. I wanted to start using IPv6 to become familiar with it but, like most ISPs, mine doesn't offer native IPv6.
When native IPv6 isn't available, one option is to use a tunnel broker. Basically a broker sets up a tunnel between your device and an endpoint at the broker. IPv6 is encapsulated in an IPv4 packet, sent through the tunnel to the broker, then sent out from there as IPv6. I looked at three brokers: Hurricane Electric, SixXS, and Gogo6 (which owns Freenet6). I chose Gogo6 for several reasons: it allows NAT traversal, it allows anonymous connections (the other two require registration), and it is touted as the easiest to set up. One of the down sides of using Gogo6 is that it currently appears to only have two Points of Presence (PoP), Montreal Canada and Amsterdam Netherlands. This is the location of the broker server, so your IPv6 traffic will appear to come from one of these areas.
To install the Gogo6 client in Ubuntu, run the following:
To install the Gogo6 client in Arch, install it from the AUR. Since this is Arch, I'll assume you know how to install a package from the AUR. To create the tunnel and start using IPv6, run (as root)
Anonymous connections are fine to play with but the IPv6 address will change when your IPv4 address changes. I suggest registering for an authenticated tunnel at Gogo6. This will get you a static IPv6 address, a DNS entry (e.g. username.broker.freenet6.net), and a /56 prefix (so you can set up a router and give out IPv6 addresses to the devices on your network if you want). If you do register, you'll have to edit the /etc/gogoc/gogoc.conf file and enter your username and password, and change the server to the authenticated one.
A couple of notes: IPv6 addresses are globally accessible, so make sure you have a firewall and that it is properly configured. And since traffic is going through a tunnel, speed will be impacted somewhat. Here are some of my speedtest results. Top bar (green) is IPv4 and bottom bar is IPv6.
Finally, here are some sites that might be of interest.
ipv6test.google.com
ipv6-test.com
ip6.me/
www.subnetonline.com/pages/ipv6-network-tools/online-ipv6-traceroute.php
When native IPv6 isn't available, one option is to use a tunnel broker. Basically a broker sets up a tunnel between your device and an endpoint at the broker. IPv6 is encapsulated in an IPv4 packet, sent through the tunnel to the broker, then sent out from there as IPv6. I looked at three brokers: Hurricane Electric, SixXS, and Gogo6 (which owns Freenet6). I chose Gogo6 for several reasons: it allows NAT traversal, it allows anonymous connections (the other two require registration), and it is touted as the easiest to set up. One of the down sides of using Gogo6 is that it currently appears to only have two Points of Presence (PoP), Montreal Canada and Amsterdam Netherlands. This is the location of the broker server, so your IPv6 traffic will appear to come from one of these areas.
To install the Gogo6 client in Ubuntu, run the following:
sudo apt-get install gogocThis will install both gogoc and radvd. The radvd package is only needed if you plan on routing IPv6 from your PC. All done! You should now have an anonymous tunnel up and running. Test it by running
ping6 -c 5 ipv6.google.comThe tunnel will start when the system starts. If you don't want this, run
sudo mv /etc/rc5.d/S20gogoc /etc/rc5.d/s20gogocThen you can start and stop the tunnel with
sudo /etc/init.d/gogoc start sudo /etc/init.d/gogoc stop
To install the Gogo6 client in Arch, install it from the AUR. Since this is Arch, I'll assume you know how to install a package from the AUR. To create the tunnel and start using IPv6, run (as root)
systemctl start gogocWait a few seconds for the tunnel to come up and try pinging ipv6.google.com as above. If there are no problems and you want to create a tunnel when the system starts, run
systemctl enable gogoc
Anonymous connections are fine to play with but the IPv6 address will change when your IPv4 address changes. I suggest registering for an authenticated tunnel at Gogo6. This will get you a static IPv6 address, a DNS entry (e.g. username.broker.freenet6.net), and a /56 prefix (so you can set up a router and give out IPv6 addresses to the devices on your network if you want). If you do register, you'll have to edit the /etc/gogoc/gogoc.conf file and enter your username and password, and change the server to the authenticated one.
A couple of notes: IPv6 addresses are globally accessible, so make sure you have a firewall and that it is properly configured. And since traffic is going through a tunnel, speed will be impacted somewhat. Here are some of my speedtest results. Top bar (green) is IPv4 and bottom bar is IPv6.
Finally, here are some sites that might be of interest.
ipv6test.google.com
ipv6-test.com
ip6.me/
www.subnetonline.com/pages/ipv6-network-tools/online-ipv6-traceroute.php
Monday, October 17, 2011
Making Tab Completion Case Insensitive in Bash
When using the bash command line, I prefer to be able to type "cd dow" and then hit Tab and have bash fill in Downloads. By default, in order to access Downloads, I would have to type an uppercase "D" ("cd Dow") and hit Tab. Luckily, this is very easy to change.
Simply type the following at the prompt:
set completion-ignore-case on
To make it permanent, add the line to either /etc/inputrc or $HOME/.inputrc. The next time you log in this will be set automatically.
Simply type the following at the prompt:
set completion-ignore-case on
To make it permanent, add the line to either /etc/inputrc or $HOME/.inputrc. The next time you log in this will be set automatically.
Tuesday, August 9, 2011
Internet Connection Sharing in Ubuntu 11.04 using Firestarter
Unfortunately, my only option for internet access is to use a 3G modem. I need to share this connection with my Bluray player and, more importantly, my Xbox. Firestarter makes this easy to do.
Firestarter is a GUI firewall for Linux that can enable Internet Connection Sharing and has lots of nice features.
I am assuming the network interfaces are already set up and working in Ubuntu. Install Firestarter from the Ubuntu Software Center or from a terminal:
Start Firestarter which will open a wizard. Click Forward at the Welcome screen. On the Network Device Setup screen, select the interface that connects to the internet. Mine is ppp0 since I'm using a 3G modem. Click Forward.
On the Internet Connection Sharing screen, enable sharing and select the interface connected to your internal network. Mine is wlan0 for my wireless connection. If you want Firestarter to act as a DHCP server for the local network, enable this feature. The default DHCP server settings should be OK. If you have a router on the local network, it is probably already acting as a DHCP server so you won't need to enable it in Firestarter. Click Forward.
On the last screen, click Save to save your settings and start the firewall.
Notes for Xbox Live:
You have to forward some ports that Xbox Live uses. Otherwise the Xbox network test will report a NAT type of Moderate (the goal is type Open). I never had any problems using Xbox Live with a Moderate NAT, but I wanted to set it to the recommendation of Open. Click the Policy tab and open ports 3074 and 88. There are other ports that Microsoft recommends to forward, but these two gave me Open status.
Firestarter is a GUI firewall for Linux that can enable Internet Connection Sharing and has lots of nice features.
I am assuming the network interfaces are already set up and working in Ubuntu. Install Firestarter from the Ubuntu Software Center or from a terminal:
sudo apt-get install firestarter
Start Firestarter which will open a wizard. Click Forward at the Welcome screen. On the Network Device Setup screen, select the interface that connects to the internet. Mine is ppp0 since I'm using a 3G modem. Click Forward.
On the Internet Connection Sharing screen, enable sharing and select the interface connected to your internal network. Mine is wlan0 for my wireless connection. If you want Firestarter to act as a DHCP server for the local network, enable this feature. The default DHCP server settings should be OK. If you have a router on the local network, it is probably already acting as a DHCP server so you won't need to enable it in Firestarter. Click Forward.
On the last screen, click Save to save your settings and start the firewall.
Notes for Xbox Live:
You have to forward some ports that Xbox Live uses. Otherwise the Xbox network test will report a NAT type of Moderate (the goal is type Open). I never had any problems using Xbox Live with a Moderate NAT, but I wanted to set it to the recommendation of Open. Click the Policy tab and open ports 3074 and 88. There are other ports that Microsoft recommends to forward, but these two gave me Open status.
Subscribe to:
Posts (Atom)






