CFEngine vim hilighting

1 Comment »

Get the highlighting code from https://github.com/neilhwatson/vim_cf3, and set it up in a location that will be loaded by default.  I’m partial to making  directory under /usr/local/share, and then linking the files in.

sudo git clone git://github.com/neilhwatson/vim_cf3.git /usr/local/share/vim_cf3
for D in /usr/local/share/vim_cf3/*; \
 do [[ -d $D ]] || continue; \
 sudo ln -s $D/* /usr/share/vim/vim72/$(basename $D)/; \
 done

Add these lines to /etc/vimrc:

" set CFEngine file type
autocmd BufRead,BufNewFile *.cf set ft=cf3
" Default to unfolding all folds on open
autocmd BufRead,BufNewFile * normal zR

I hate having keyword expansion turned on by default.  There’s a parameter provided that you can add to vimrc to turn that off, but just on the principle of the thing, I’d rather have it default to “off” when installed as a global file, and allow individual users to turn it on if they really want to have their editor change things on them.  Here’s a patch against ftplugin/cf3.vim.  It’ll break if the file is updated in git at some point, but my hope is that, one day, I can get Neil convinced that this should be off by default. :)  You can run this with copy-paste by running “cat – | patch -p0 cf3.vim” and pasting this in, then hitting <CTRL>+D.

@@ -23,7 +23,7 @@
 
 " =============== Keyword Abbreviations  ===============
 " disable keyword abbreviations with by adding 
-" "let g:DisableCFE3KeywordAbbreviations=0" to your vimrc
+" "let g:EnableCFE3KeywordAbbreviations=0" to your vimrc
 " Conveniance function ToggleCFE3KeywordAbbreviations
 " mapped to ,i by default to toggle abbreviations off or on
 "
@@ -76,18 +76,18 @@
 endfunction
 
 " Default abbreviations on
-" to disable let g:DisableCFE3KeywordAbbreviations=1 in ~/.vimrc
-if !exists('g:DisableCFE3KeywordAbbreviations')
-    let b:DisableCFE3KeywordAbbreviations=1
+" to disable let g:EnableCFE3KeywordAbbreviations=1 in ~/.vimrc
+if exists('g:EnableCFE3KeywordAbbreviations')
+    let b:EnableCFE3KeywordAbbreviations=1
     call EnableCFE3KeywordAbbreviations()
 endif
 
 function! ToggleCFE3KeywordAbbreviations()
-    if !exists('b:DisableCFE3KeywordAbbreviations')
-        let b:DisableCFE3KeywordAbbreviations=1
+    if exists('b:EnableCFE3KeywordAbbreviations')
+        let b:EnableCFE3KeywordAbbreviations=1
         call EnableCFE3KeywordAbbreviations()
     else
-        unlet b:DisableCFE3KeywordAbbreviations
+        unlet b:EnableCFE3KeywordAbbreviations
         call DisableCFE3KeywordAbbreviations()
     endif
 endfunction

Galaxy S3 and stupid SSL support

No Comments »

Ok, I found something I dislike about my Galaxy S3. Apparently, in order to trust a third-party (in this case, my own) SSL signing certificate, I need to change my authentication mechanism. If I have any non-default signing authorities on my phone, the option to do face unlock and voice unlock are disabled; you can only install them if you have a pin code or passphrase lock. Further, you can’t change the auth mechanism back to a “less secure” option until after you’ve removed those signing certificates.

I guess that I have to choose between trusting my own signing authority, and using a convenient authentication mechanism to get in to my phone.

If anyone happens to know of a workaround that lets me use face unlock *and* trust a couple of SSL certificate authorities, I’d sure appreciate it. I’m willing to accept the risk of someone taking my phone, unlocking it with a picture of me, and installing an additional certificate signing authority. :/


Laziness

No Comments »

So yeah, I’m still not so good about posting regularly. But I set up the WordPress app on my fancy new smartphone. Maybe that will encourage me to post more. Our maybe not. We’ll see.


Water neck O-Rings

No Comments »

So, I got some new O-Rings for my water neck today. They’re Viton rather than regular rubber, which means it’ll work with a higher heat range. And viton doesn’t “learn” a compressed state (that’s why Holley uses it for carb needle valve tips), so reusability should be better (combined with the slightly harder material I selected) – and it’s just a hair thicker than the regular replacements. But I had to get like 20 of the things. So, if you have a leaky Mr Gasket or similar O-Ring water neck (2 1/8″ inside diameter o-ring, 1/8″ thick), lemme know – I have way more than I need, and I know several other people have these things leaking all over their hoods.

In the quantity I got, they cost me about $3 each, so I’m willing to drop them in the mail for that price. If you want one, contact me – or just send the money via PayPal to paypal@dannysauer.com and I’ll drop one (or however many you want) in an envelope and send it to you.

Here’s a couple of pictures of them, showing how much better these fill out the groove than the ones you get at the parts store:

20120901_142904 20120901_142900


Ping localhost failed in BackupPC after Ubuntu 12.04 upgrade

No Comments »

After upgrading my backup server from the previous LTS release (Lucid) to the new one, the config which backs up /etc on localhost was failing.  It was failing because pings to localhost were failing.  This is no good – localhost should be pingable. :)  Ultimately, this is because IPv6 is enabled by default now.  I don’t use IPv6 on my internal network, mostly because it’s new and scary and I don’t like change.  Or because I just don’t need it.  So, here’s how to disable IPv6 on your Ubuntu 12.04 / Precise box:

sauer@pyro:~$ ip addr show lo
 1: lo: mtu 16436 qdisc noqueue state UNKNOWN
 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 inet 127.0.0.1/8 scope host lo
 inet6 ::1/128 scope host
 valid_lft forever preferred_lft forever
 sauer@pyro:~$ sudo sysctl net.ipv6.conf.all.disable_ipv6
 net.ipv6.conf.all.disable_ipv6 = 0
 sauer@pyro:~$ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
 net.ipv6.conf.all.disable_ipv6 = 1
 sauer@pyro:~$ ip addr show lo
 1: lo: mtu 16436 qdisc noqueue state UNKNOWN
 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
 inet 127.0.0.1/8 scope host lo

Note how the inet6 address goes away as soon as ipv6 is disabled.  This will be in effect until you next reboot.  To make it permanent, you can create a file in sysctl.d and apply that (then run sysctl again just to make sure it was set):

sauer@pyro:~$ echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee /etc/sysctl.d/60-disableipv6.conf
net.ipv6.conf.all.disable_ipv6 = 1
sauer@pyro:~$ sudo start procps
procps stop/waiting
sauer@pyro:~$ sudo sysctl net.ipv6.conf.all.disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1

The other option is to actually configure the path to ping6 in the BackupPC config file (/etc/backuppc/config.pl) by putting in a value for Ping6Path – such as $Conf{Ping6Path} = ‘/bin/ping6′;  The default config on newer systems has that parameter set to an empty string; older installs which have been upgraded don’t even have that parameter included.

Your choice of solution will vary based on whether or not you use IPv6.  If you don’t know, then you’re not using IPv6 and can pretty safely just disable it.  Otherwise, just configure BackupPC the way it should’ve been configured to begin with.


xfs v/s reiserfs storage

No Comments »

So, since I have to rebuild my mp3 library anyway, I thought I’d do a comparison between storing my mp3s on either reiserfs or xfs.  I already know that reiserfs is horrible for recovery, but hopefully I won’t need that.  Reiser is supposed to be good for storage because of the tail-packing thing, though.

I’ve recovered about 18GB of songs now, the biggest file is about 50MB; the average is about 8MB.  Somewhat surprisingly, the xfs filesystem (/mnt/a) actually is using less space to store the identical directory structure (artist/album/mp3).

 sauer@humpy:~$ for D in /srv/nfs4/music /mnt/a;
  do find $D | wc -l; done
 1589
 1589
 sauer@humpy:~$ du -ks /srv/nfs4/music /mnt/a
 12380231        /srv/nfs4/music
 12369836        /mnt/a
 sauer@humpy:~$ df -k /srv/nfs4/music /mnt/a
 Filesystem           1K-blocks      Used Available Use% Mounted on
 /dev/mapper/idevol-music
 52427196  12414684  40012512  24% /srv/nfs4/music
 /dev/mapper/idevol-music2
 52403200  12403660  39999540  24% /mnt/a
 sauer@humpy:~$ sed -n '/music/p' /proc/mounts
 /dev/mapper/idevol-music /srv/nfs4/music reiserfs rw,noatime 0 0
 /dev/mapper/idevol-music2 /mnt/a xfs rw,relatime,attr2,delaylog,logbsize=64k,sunit=128,swidth=384,noquota 0 0

So, since xfs also recovers faster and is more actively maintained, I’m switching to xfs.


Add h264 support to ffmpeg on Ubuntu

No Comments »

So, I’ve got a handful of Ubuntu machines.  I also have a bigger handful of DVDs.  I’d like to conver the DVDs to easier-to-store videos which can be accessed by MythTV, XBMC, my mobile devices, and whatever else easily.  The best broadly-supported format to do that in is h264-encoded mp4 files.  And DVD::Rip does a nice job of letting me use all 20 or so CPUs I have laying around, rather than limiting me to just one workstation.

Unfortunately, DVD::Rip uses transcode, which uses ffmpeg to do the encoding.  And Ubuntu’s ffmpeg, for whatever reason, lacks h264 support.  There’s a guid to rebuilding it which has you pull down the latest source for all the utilities from CVS, and make new packages which don’t work right and are a pain to maintain.  I, on the other hand, want to just take the Ubuntu package and add one compile-time option, so it’ll still work like the vendor-provided package.  After all, all I ned to do is build the exact same thing with the “–enable-libx264″ option.  Here’s how.

Read the rest of this entry


Making BackupPC work on Windows

1 Comment »

So, every time I set up a new Windows system to be backed up with BackupPC, I forget what I need to change.  Thus, a blog entry.

Windows XP:

  • Right-click on a folder somewhere in order to share it.  Probably the C drive.  There’ll be something indicating that file sharing is disabled.  Click through the network wizard thingie to enable file sharing.
  • Create a backup user.  I prefer to call the user backuppc.  Go to the admin tools and “user and groups” to create the user, and put the user in the Backup Operators group.  Set a password, and set the password to never expire + can’t be changed.  Use the same settings for the machine-specific config inside BackupPC.
  • In Administrative Tools, go to the Local Security Policy, and under User Rights Assignments, remove Backup Operators from the “Log On Locally” set (no reason for our remote backup operator to be on the log in screen). Also under Security Options, set “Network Access: Sharing and Security Model for Local Accounts” to “Classic – local users authenticate as themselves”.  The default is to access the machine as a guest after authentication, which is crazy to me (and breaks the ability for backup users to access all files in the C$ share).
  • Other minor things – validate that the firewall is set to allow file sharing services in.

Test:

smbclient -U backuppc \\\\yourwindowsmachine\\C\$

A good introductory computer book

No Comments »

This book was written by a friend of mine, so I’m biased – but it really is a good generic computer book.  And I don’t mean “generic” in the negative connotation way; rather, I mean it teaches the skills to figure out how to use a computer, rather than teaching how to use a specific program or even a specific type of computer.  It’s geared mostly toward people who didn’t grow up with a computer, and who could use something to get them a some confidence in both navigating a computer system and experimenting to find out what works.  You know, the way “computer people” probably learned.  If you or someone you know is a computer novice, this would be a good gift to follow up the computer they finally got themselves for Christmas, or whatever. :)

http://explaintechnology.wordpress.com/2011/11/28/gift-pc-primer/


Ubuntu One hassles

No Comments »

Recently, I had the “this folder cannot be synchronized because it contains one or more folders that are already synchronized” problem on an Ubuntu system (midnight) which was upgraded a few times (most recent clean install was four or five releases ago).  The folder would not allow me to check the “Synchronize this folder” box most of the time, and when it did let me check the box (right-click, Ubuntu One->synchronize this folder), it wouldn’t stick.  I also had problems with the Ubuntu One frontend displaying.  I have four other Linux machines and a Windows system (mostly just for ripping my DVDs, since that software way is easier on Windows) syncing up just fine, but this one simply would not work.

Here’s what the u1sdtool command showed:

sauer@midnight:~$ u1sdtool --list-folders
Folder list:
  id=6fada2b6-4a18-48ca-951f-34092a59e4d6 subscribed=False path=/home/sauer/Documents
  id=80629790-b80b-4200-8b7e-a405842fd2ff subscribed=False path=/home/sauer/Pictures
  id=d23fed2c-042a-4862-81f7-783e9832dc71 subscribed=False path=/home/sauer/Music

Oh.  So, it knows about the folders, but doesn’t want to sync (note the “False”).  So, I just ran u1sdtool --subscribe for each of them, as in:

u1sdtool --subscribe-folder=80629790-b80b-4200-8b7e-a405842fd2ff

and it worked fine. The box in Nautilus became checked, the pop-up dialog indicated that files were being downloaded, and stuff started appearing in the folder.

Since I haven’t seen that particular solution anywhere yet, I figured it was worth tossing up on the blog.  It’s working now, and though the GUI for Ubntu One still isn’t behaving, it’s actually sync’ing files up – which is all that really matters to me on this machine.

sauer@midnight:~$ u1sdtool -s
State: QUEUE_MANAGER
    connection: With User With Network
    description: processing the commands pool
    is_connected: True
    is_error: False
    is_online: True
    queues: WORKING