Sunday, July 13, 2014

Changing timezones


$ timedatectl status

To list available zones:

$ timedatectl list-timezones

>>> Europe/Budapest


$ Set them
timedatectl set-timezone Europe/Budapest
timedatectl set-timezone Europe/London

Automatic wifi on startup


 # Generate the profile is using the
wifi-menu -o
The profile will be output to /etc/netctl/


# Enable the newly generated profile and remove any old links
 netctl enable wlp3s0-ThirtyT 


# [root@kinleytpad /]# netctl enable wlp3s0-ThirtyT                                                                                                                  
# ln -s '/etc/systemd/system/netctl@wlp3s0\x2dThirtyT.service' '/etc/systemd/system/multi-user.target.wants/netctl@wlp3s0\x2dThirtyT.service'
# [root@kinleytpad /]# rm /etc/systemd/system/multi-user.target.wants/netctl\@wlp3s0\\x2dDoppio.service 
 

Thursday, December 26, 2013

Write ISO to DVD


pac  dvd+rw-tools cdrtools
sudo modprobe loop

# Check device
wodim dev=/dev/sr0 -checkdrive

 # Add my user to the optical group to gain privileges to writing  /dev/sr0
sudo usermod -a -G optical kinleyage

# Start writing
growisofs -dvd-compat -Z /dev/sr0=/media/automatic/element/box/softwareABC.iso


Thursday, November 28, 2013

System crash after awaking from pm-suspend

I've frequently experienced X11 segmentation failures after waking up from being in suspend mode, and after some reading, I tried the following suggestion:
Set partittion representation to be by uuid rather then name, because dbus startup delay might cause this error
 /boot/syslinux/syslinux.cfg

 LABEL arch
          MENU LABEL Arch Linux
          LINUX ../vmlinuz-linux
          APPEND root=UUID=aa6cc75e-aae7-413c-babf-946f329b2a50 ro 
          INITRD ../initramfs-linux.img

Wednesday, November 27, 2013

Organising MusicLibrary and ID3's


The way I find it most convenient to maintain my music library is using
  • ranger (file navigation and moving)
  • rsync (syncing directories)
  • easytag (ID3v2 editor)
  • and vidir (file renaming tool)

Synchronising the content of my music library and the local drive is done with the following simple music_rsync_existing script

# Selective music file and ID3 syncing from external drive (element)
# Music domain lives on the external drive, organised by artist directories
export MUSIC_ELEMENT=/media/automatic/element/box/music/ # External (domain) path
export MUSIC_KNMEDIA=/mnt/knmedia/music/ # Local path

alias music_copy_all="rsync -rv $MUSIC_ELEMENT $MUSIC_KNMEDIA --progress"

# Remove all that artist folders which end with _ (they must be duplicates)
alias music_remove_duplicates="find $MUSIC_KNMEDIA -type d -print| grep -E \"^.*_$\" | xargs -d\"\\n\" rm -rvf"
#                                                   dirdectory         regex                 separator  cmd

#   Alternative regex search: 
# find . -type d -regextype posix-extended -regex '.*_$' -print|xargs -I{} -0 ls -rvf {}

# Individually rsync all artist folders with
music_rsync_existing(){
 music_remove_duplicates;
 for kn_path in $MUSIC_KNMEDIA*; do
     if [ -d "${kn_path}" ]; then
  element_path=$MUSIC_ELEMENT`basename ${kn_path}`
  echo "rsync -rv --update --delete $element_path/ $kn_path/" #--progress
  # Sync only ID3 changes on existing ones, delete the ones that only exist on destination 
  #   (no checksum, only mod date and size)
  rsync -rv --update --delete $element_path/ $kn_path/
     fi
 done
} 
Some useful keys
# Ranger tab jumping <Tab>
# Rename Dirs <Key s> for :shell
:shell vidir
# Edit tags
:shell easytag. 

To update mpd, you'll need mpc and 
mpc update path/to/update-dir/as/defined/in/mpd.con

Friday, November 1, 2013

Immutable flag

chattr +i ~/.ssh

autofs with removables

Removable devices


auto.master
 /media/automatic /etc/autofs/auto.media --timeout=5

Check /dev/disk/by-* and append to your auto.media by UUID (or label if you wish)

element  -fstype=auto,async,nodev,nosuid,umask=000  :/dev/disk/by-uuid/442462FA2462EDFC

Append line to /etc/nsswitch.conf
automount: files

mount|grep element| sed .... (to be continued)

in conky  :)
 ${if_mounted /media/automatic/element}Element :: $else${endif}


Stopped working (2014.Aug)
Debug:  
stop the daemon 
# systemctl restart autofs

run in non daemeon verbose mode 
# automount -vdf

Problem: autofs appends -s option (Tolerate sloppy mount options) which is not supported by the ntfs-3g, hence each time autofs calls mount it fails



Workaround: didn't fixi it, instead I've decided to manually mount it and unmount it
alias element_mount="sudo mount -t ntfs-3g -o umask=000 /dev/disk/by-uuid/442462FA2462EDFC /media/element"

Workaround2: http://archlinuxarm.org/forum/viewtopic.php?f=53&t=7673