Posts

VirtualGL on Fedora 21

It isn't generating the key so the xauth merge fails This link fixes paths, and I think might be relevant for my problem https://github.com/chenxiaolong/Fedora-SRPMS/blob/master/VirtualGL/fix-paths-in-vglgenkey.patch diff -Nru VirtualGL-2.3.orig/server/vglgenkey VirtualGL-2.3/server/vglgenkey --- VirtualGL-2.3.orig/server/vglgenkey 2012-02-25 00:12:07.913553458 -0500 +++ VirtualGL-2.3/server/vglgenkey 2012-02-25 00:23:01.450462350 -0500 @@ -1,17 +1,14 @@ #!/bin/sh XAUTH=xauth -if [ -x /usr/X11R6/bin/xauth ]; then - XAUTH=/usr/X11R6/bin/xauth +if [ -x /usr/bin/xauth ]; then + XAUTH=/usr/bin/xauth fi -if [ -x /usr/openwin/bin/xauth ]; then - XAUTH=/usr/openwin/bin/xauth +if [ ! -d /etc/VirtualGL ]; then + mkdir -p /etc/VirtualGL fi -if [ ! -d /etc/opt/VirtualGL ]; then - mkdir -p /etc/opt/VirtualGL +if [ -f /etc/VirtualGL/vgl_xauth_key ]; then + rm /etc/VirtualGL/vgl_xauth_key fi -if [ -f /etc/opt/VirtualGL/vgl_xauth_key ]; then - rm /etc/opt/VirtualGL/vgl_xauth_key -fi -...

Enable ssh tunnel to home via systemd

# vi /usr/local/bin/vpntohome.sh     #!/bin/bash     su - vpntohome -c "screen -D -m /home/vpntohome/vpntohome" # chmod 700 /usr/local/bin/vpntohome.sh # vi /lib/systemd/system/vpntohome.service     [Unit]     Description=Start SSH tunnel to applesauce     After=syslog.target network.target sshd.service     [Service]     Type=simple     ExecStart=/usr/local/bin/vpntohome.sh     RestartSec=120     [Install]     WantedBy=multi-user.target # cd /etc/systemd/system/ # ln -s /lib/systemd/system/vpntohome.service vpntohome.service # systemctl daemon-reload # systemctl start vpntohome.service # systemctl enable vpntohome.service

Backups with gpg encryption

# As root gpg --gen-key gpg --export-secret-keys --armor root@host.example.com > root-privkey.asc # copy root-privkey.asc to a safe place non-online place # export the public key for encrypting and signing gpg --export --armor root@host.example.com > /tmp/root-pubkey.asc # import the key into the backup creator's key ring gpg --import  /tmp/root-pubkey.asc gpg --edit-key root@host.example.com ## sign it ## trust it ultimately # modify the backup script to pipe through gpg gtar --totals --bzip2 --create --exclude=Favicons ..... | gpg --encrypt --recipient root@host.example.com > real.backup.filename.here.bz2.gpg

Create a custom tool for p4v to spawn Rubymine on a directory straight out of p4v

Create a new script: mkdir -p ~/bin/generic/run-rubymine-as-a-tool.sh vim ~/bin/generic/run-rubymine-as-a-tool.sh #!/bin/bash if echo "${1}" | grep -q '...$'; then   DIR="`dirname ${1}`" else   DIR=${1} fi exec ${HOME}/bin/RubyMine/bin/rubymine.sh "${DIR}" chmod 0754  ~/bin/generic/run-rubymine-as-a-tool.sh Under p4v: Tools -> Manage Custom Tools -> New Tool Name: Rubymine Select: Add to application context menus Application: ~/bin/generic/run-rubymine-as-a-tool.sh Arguments: %d

Fedora 21 ntpd restart problems after boot

This seems to finally have got it working across boots sudoedit /usr/lib/systemd/system/ntpd.service [Unit] Description=Network Time Service After=syslog.target ntpdate.service sntp.service multi-user.target network.target sshd.service Conflicts=systemd-timesyncd.service [Service] Type=forking EnvironmentFile=-/etc/sysconfig/ntpd ExecStart=/usr/sbin/ntpd -u ntp:ntp $OPTIONS PrivateTmp=true [Install] #WantedBy=multi-user.target WantedBy=default.target sudoedit /etc/systemd/system/ntpd.service.d/restart.conf [Service] Restart=always RestartSec=17 sudo systemctl daemon-reload sudo systemctl restart ntpd.service Update: still a problem finally googled right, it is %#(%^&(#^ service called chrony.

Rotating the linux console with Intel HD graphics

I've never gotten this to work with Nvidia cards, but with my mac mini with Intel Iris graphics, you can: /bin/echo "3" > /sys/devices/virtual/graphics/fbcon/rotate To rotate the display counter-clockwise 90 degrees, which is very helpful if you are trying to restore a system with monitors in portrait mode.

Changing the file descriptor of a running process

Found this today: http://ingvar.blog.redpill-linpro.com/2010/07/10/changing-a-process-file-descriptor-on-the-fly/ pretty cool. #!/bin/bash # # Swap/Roll a logfile # # Usage: <old logfile> <new logfile> [ optional pids ] # ./swap.sh /var/log/logfile /tmp/logfile [pids] # # Author: Robert McKay <rob...@mckay.com> # Date: Tue Aug 14 13:36:35 BST 2007 # # Update: Added usage message when needed, a fuser format fix, # some whitespace cleanup, and a localization fix. # Ingvar Hagelund <ingvar@redpill-linpro.com> # Date: Sat Jul 10 02:11:49 CEST 2010 if [ "$2" = "" ]; then echo "Usage: $0 /path/to/oldfile /path/to/newfile [pids] Example: $0 /var/log/somedaemon.log /var/log/newvolume/somedaemon.log 1234 Example: $0 /dev/pts/53 /dev/null 1234 " exit 0 fi if gdb --version > /dev/null 2>&1; then true else echo "Unable to find gdb." exit 1 fi src=$1 dst=$2 ...