Monday, 20 January 2014

Creating disk images in mac osx with DD and diskutil

I keep forgetting the diskutil commands so I've dumped them in the this post. To use dd in mac you have to remember to umount the volume first (as everything gets auto mounted)

mount - find the path for the mounted volume i.e /dev/disk3s1 (diskutil list) is also useful
sudo diskutil unmount /dev/disk3s1 - unmount it
sudo dd bs=512k if=imagefile.img of=/dev/disk3

Saturday, 18 January 2014

opensuse repository for transmission 2.42

ftp://ftp5.gwdg.de/pub/opensuse/repositories/openSUSE:/Maintenance:/1433/openSUSE_12.1_Update/


Friday, 3 January 2014

Creating a new service definition for Suse firewall

I use uhare a bit at home and I wanted it to work nicely with SuSE Firewall.

All I had to do was create a new service description in /etc/sysconfig/SuSEfirewall2.d/services/ (I called mine ushare) and created the file accordingly.

I copied it from the  /etc/sysconfig/SuSEfirewall2.d/services/TEMPLATE

After a bit of reading it seems you can use a service name corresponding to an entry in /etc/services or just the port number. I used the latter. I also had to set this port appropriately in /etc/ushare.conf
## Name: ushare Server
## Description: Opens ports for ushare

# space separated list of allowed TCP ports
TCP="49200"
Now I can just select the service from the drop down in the firewall gui. For me this fits the workflow I would use from Juniper SSG (custom services)

openSUSE KVM getting started notes

Some sparse notes on installing KVM on openSUSE locally

Configure libvirtd
 Firstly, lets not have to be root every time I want to use virt-manager and without using policy kit.  In /etc/libvirt/libvirtd.conf uncomment and set
unix_sock_group = "libvirt"
unix_sock_ro_perms = "0770"
unix_sock_rw_perms = "0770"
auth_unix_ro = "none"
auth_unix_rw = "none"
(https://doc.opensuse.org/documentation/htmlsingle/openSUSE_122/opensuse-kvm.html#sec.libvirt.connect.auth.libvirt.traditional)

Set default url
I'm just using kvm locally and I don't want to have to type virsh -c qemu:///system every-time to admin on the command-line so I create
~/.config/libvirt/libvirt.conf
and add
uri_default = "qemu:///system"
Now I can just type
virsh list --all
(http://libvirt.org/uri.html)

virsh command hosts
virsh nodeinfo dump CPU and RAM info for the hypervisor 
virsh commands domain management
virsh list --all list info on all vm (domains)
virsh (start|shutdown|reboot|reset) domain
virsh (suspend|resume) domain
virt-viewer domain - open the graphical console for the domain
virsh commands domain info gathering
virsh dominfo domain - show overview of domain (name, cpu, state etc)
virsh domstate domain - show the state of the domain (shut off, running etc)
virsh dumpxml domain - dump the xml configuation for the domain to stdout
virsh edit domain - open the xml configuration for the domain in $EDITOR 
virsh define (file) - import a domain from an xml config 

Thursday, 17 October 2013

Openelec XBMC CEC LG Remote remap

I picked up a raspberry pi to replace my Xbox XBMC was has lasted so well but is not powerful enough to play the HD MKVs I download.

One issue I found with the LG remote control I was using (on a one for all) was that the fastforward buttons were actually set to skip and the skip buttons were set to fastforward and rewind.  Also, the remote was not passing on any of the colour buttons through CEC which meant there was no extra buttons I could use for mapping an info button and a context menu button.  Also, coming from Xbox XBMC I was missing the codec info and the aspect ratio panels during playback.

Anyway, by creating /storage/.xbmc/userdata/keymaps/keymap.xml I was able to re-map the incorrect scan buttons and use the skip buttons for info and context along with the apect ratio and codec details panels I was used to from Xbox XBMC

<keymap>
<global>
    <remote>
            <skipplus>FastForward</skipplus>
            <skipminus>Rewind</skipminus>
            <forward>ContextMenu</forward>
            <reverse>Info</reverse>
    </remote>
</global>
<FullscreenVideo>
    <remote>
            <forward>CodecInfo</forward>
            <reverse>AspectRatio</reverse>
    </remote>
</FullscreenVideo>
</keymap>

Friday, 20 September 2013

Zsh don't match

Not sure how I have lived without this

Match stuff (we all know this)
ls *.mkv

Dont match stuff
ls ^*.mkv

Tuesday, 4 June 2013

Block cmd w from closing xterm window on mac

After doing this at least twice in 24 hours I thought I better sort this out. You can block cmd w (close window) and assign it to something else to stop this from happening.

Goto System Preferences -> Keyboard -> Keyborad Shortcuts -> Application Shortcuts

Then Add (+)

Application = X11.app
Window = Close
Shortcut = Whatever you want I use cmd+shift+w

Danke.