Here is an example of a shader written in the OpenGL Shading Language (GLSL). It is very simple shader, only assigning 4 different color values, yet the result is pretty cool. I’ll post the link to the source code once I add it to my git repository.
For introductory material on GLSL, check out Lighthouse 3D (where I got this cartoon example). Also check out the orange book for more in-depth discussion and examples on shaders.
Recently the rsync server at work broke down, and I needed a quick solution for incremental backup using just FTP. As it turns out, the FreeBSD version of tar is not GNU tar. So in order to use the following trick on FreeBSD, the gtar port must be installed. Once you have the software, making an increment backup with tar is easy:
The tar-incremental.log file must be saved as it contains information for the incremental backup. Every time you run this file a new file will be created, so do not over-write your files. A more in-depth discussion can be found on the GNU tar incremental backup page.
If you run arch linux or a similar minimal distro, you may be familiar with the local dns server pdnsd, used to cache DNS queries. If you try to run pdnsd on the same computer as NetworkManager, you may run into a problem. Using default configurations, your DNS lookups end up in a vicious loop redirecting to 127.0.0.1. To circumvent this problem, I did the following.
I let NetworkManager generate my /etc/resolv.conf file. I then copied it to /etc/resolv.conf.head. Once this was done, the server section in /etc/pdnsd.conf was edited to contain the following:
server {
label= "comcast;
file = "/etc/resolv.conf.head"; # Preferably do not use /etc/resolv.conf
# proxy_only=on; # Do not query any name servers beside your ISP's.
timeout=4; # Server timeout; this may be much shorter
# that the global timeout option.
uptest=if; # Test if the network interface is active.
interface=wlan0; # The name of the interface to check.
interval=10m; # Check every 10 minutes.
purge_cache=off; # Keep stale cache entries in case the ISP's
# DNS servers go offline.
}
Notice the file variable which tells pdnsd where to find the nameservers it will query. Once this is complete, the pdnsd daemon can be restarted. Now, NetworkManager must be told to use localhost for DNS lookups. This can be done by right-clicking the nm-applet icon and configuring the wireless for “Automatic (DHCP) Address Only”, and enter 127.0.0.1 as the DNS server. Once this is complete, you can test it with the following commands:
The second time the command was called, the cached result was fetched. If your Query time is greater than 1ms, it is likely that something is misconfigured.
After installing arch linux on my laptop, I noticed a small annoyance. When I opened any sort of terminal in Xorg, they key repeat feature would not function (i.e. holding a key down would not cause it to continuously be entered). The solution turns out to be quite simple: