Filed under Uncategorized | by Samuel Huckins | Date Posted: March 31, 2007 - 11:58 AM
After discovering that the clocks on several of the servers I work with now were out of sync, I decided to check my own system’s accuracy. The simple command “ntpdate [server]” (on Ubuntu by default) will sync your clock with whatever server you select. “ntp.ubuntu.com” or any of the North American NTP pool servers (e.g., 0.north-america.pool.ntp.org) will work fine.
However, before you think of the clever idea of adding this command to a cron job or startup script, know that there is a better way: ntpd. This is a daemon that is designed to bring your clock in sync with time from the atomic clock time servers optimally. It adjusts the time to a synchronized state in small increments so as not to harm programs that rely on a regular passage of time, and so that your logs don’t appear to jump. It works very well, and keeps your clock as accurate as possible all the time.
One catch: ntpd is not installed on Ubuntu by default, as they did not want any network listening apps installed on the desktop version by default. And good for them to improve security. The problem is that ntpd will not be found in the repos. It goes under the guises “ntp-simple” and “ntp-refclock”. The latter is really only when you want to set up your own time server, and have the means to do so. The former is what should be used to keep “simple” (single, personal) systems synced. So install that.
There are a few more steps left. Run ntpdate to get the current time:
sudo ntpdate ntp.ubuntu.com
Then edit /etc/ntp.conf:
sudo vim /etc/ntp.conf
Add the lines after these 2 (should be there already):
# You do need to talk to an NTP server or two (or three).server ntp.ubuntu.comserver 0.north-america.pool.ntp.orgserver 1.north-america.pool.ntp.orgserver 2.north-america.pool.ntp.orgserver 3.north-america.pool.ntp.org
Lastly start up the ntp server:
sudo /etc/init.d/ntp-server start
To see the results:
sudo ntpd -p
Tags:
CLI
March 31, 2007 - 11:58 AM
Filed under Desktop | by Samuel Huckins | Date Posted: March 30, 2007 - 9:49 AM
I accidentally discovered an awesome shortcut in Firefox today. I wanted to switch to a workspace in fluxbox, but my sausage finger excuses for fingers pressed Alt+4, not F4, of their own volition. Serendipitously, Firefox had focus at the moment, and I was surprised to see my current tab switch… With confusion and adumbrated glee, I tried my mistake again. It turns out that Alt+NUMBER switches to that tab in the current Firefox window, handily similar to workspace switching. It is a great shortcut.
On an unrelated note, I was still having problems getting my fonts to look how I wanted in fluxbox. A friend directed me to try running “gnome-settings-daemon” (add “gnome-settings-daemon &” somewhere in .fluxbox/startup) at boot. Upon doing this, my fonts automagically looked as they should. I don’t know what it does exactly, but run it.
Tags:
Desktop
March 30, 2007 - 9:49 AM
Filed under Desktop | by Samuel Huckins | Date Posted: March 30, 2007 - 9:21 AM
On rare occasions, one encounters a tool or application which makes blithely simple a task which was once annoying/hard/cumbersome/painful. Such a thing have I seen today:
nvidia-settings. It has long been the case that having an NVIDIA graphics card has made using a GUI much simpler in Linux (although support from other vendors has been increasing). However, trying something as crazy and far-fetched as… dual monitors… has been somewhat of a dreadful task, involving much editing of xorg.conf, tears on the keyboard when startx reveals another error, et cetera ad nauseum. No, I don’t want to see detailed output. I want a simple feature of having 2 monitors to work.
NO MORE! Simply type “sudo nvidia-settings” (in some window manager of course, gnome, kde, etc. Or fluxbox, if you are that cool), and a pretty little interface comes up, where you can do all the obscenely obvious things that one would want to do in configuring a graphical interface, like set up 2 monitors, configure refresh rate, and much much more.
It’s amazing. In a few clicks, saving to my xorg file, and a restart of X, I had everything configured how I wanted it. No pain. No errors.
Dude, is Linux made of leprechauns? Cause it is awesome!
Tags:
Desktop
March 30, 2007 - 9:21 AM
Filed under Uncategorized | by Samuel Huckins | Date Posted: March 17, 2007 - 10:33 PM
Recently, I came across some rather neat, if obscenely geeky, things to do with sound in linux. Actually, the first can be EXTREMELY useful. Often, using new systems, I do something that results in the PC speaker squawking. If it is trying to use tab-complete in a dir with too many matches available, or a bad VIM command, that tiny speaker decides to notify me of the error of my ways. After this happens one or two times, I am sorely tempted to put my fist through the computer, just to stop that wretched sound. There is a better way, viz., “modprobe -r pcspkr”. This effectively kills the PC speaker, for your current session. No more squawking, no more pain. Once you logout, the speaker works fine, it just temporarily saves you the annoyance.
Another thing I have been experimenting with is much cooler. Apparently, you can take any file and send it to your speaker. To try this, get into the CLI, and first do “wget www.cnn.com”. Then do “cat index.html > /dev/dsp”. Of course, you can dispense with downloading cnn.com’s homepage and use any file you want, of any type. Even “ls /etc > /dev/dsp” will do. As long as your sound is enabled, you will get some static. I believe what is actually happening is that you are sending the binary content of whatever you pass to your sound card, and it is playing through the speaker. Images, I find, are particularly interesting. An amusing experiment I have not finished: Make a recording, hopefully a comical one, encode it, and turn its binary content into some text. Embed this in a hidden div in a web page, and get someone to try the above commands on the page. I don’t know anything about encoding, or much of anything at this level, but it is fun to play with.
Tags:
CLI
March 17, 2007 - 10:33 PM
Filed under Desktop | by Samuel Huckins | Date Posted: March 17, 2007 - 9:46 PM
While configuring my Fluxbox setup, I decided I wanted transparent terminals tailing various logs, or running top, from startup. I described getting most of this setup in a previous post. Since then, I ran into and solved two additional problems. The first is a result of specifying the positioning and size of the eterm windows via their title bar, using “Remember”, which writes to .fluxbox/apps. Doing this for a transparent window can cause a black bar to appear at the bottom of said window. This is because of the second issue I ran into. When specifying the geometry of eterm through the command line option “-g”, the format is “-g NUMOFCOLUMNSxNUMOFROWS+XOffset+YOffset “. The Offset items are in pixels, but the column and row specifications are in, of course, columns and rows, i.e. character widths and rows. So a setting of “-g 80×50+0+500″ would make a window holding 80 columns, 50 rows, and it would be placed flush with the left side of the screen, and 500 pixels from the top.
This difference in units is what causes the black bar to appear when using Remember to set eterm’s position and dimensions. This is because the Remember setting is in pixels, and a given set of pixel dimensions will not usually correspond to the exact number needed for a whole number of rows. I believe this difference causes the black bar.
Tags:
Desktop
March 17, 2007 - 9:46 PM