PND4

/dev/notes

Gentoo - Genkernel Upgrade Steps

I use genkernel to install my kernel.. this isn't the best way to do things but for now it gets the job done. Gentoo isn't my primary distro so I sometimes forget the steps to go through when they push a new kernel.

Make sure Gentoo is matched up with your target kernel version

1
2
eselect kernel list
eselect kernel set #

Build it

1
2
3
4
5
6
7
zcat /proc/config.gz > /usr/src/linux
cd /usr/src/linux
make oldconfig
make modules_prepare
emerge --ask @module-rebuild
make
make modules_install

Install it

1
genkernel --no-menuconfig --no-clean --install all

Update bootloader

1
vim /boot/extlinux/extlinux.conf

Reboot and cross your fingers.

Clean-up/delete old files in /boot and corresponding bootloader entries.

Useful Links and References

  1. Gentoo Wiki: Kernel/Upgrade

IPTables + Transmission + VPN

Transmission doesn't have a way to bind to specific interfaces without patching, and I like the simplicity of using a package manager like 'pacman' vs patching 'BindInterface' into Transmission and building it from source. The work-around, since Transmission can bind to an IP, is to run a script with cron periodically. The script should basically:

  • first make sure the VPN is up and operational
  • correct transmission's config if the address isn't current.. [stop, edit, start]
  • definitely end with transmission running

Quote

Enforcing an application, for example a torrent client like Transmission, to always use the VPN interface or any particular network interface for that matter, is trivially simple using iptables on Debian, Ubuntu or any other GNU/Linux distro. Personally, I am running Debian Sid on the Raspberry Pi. Occasionally I use it for downloading files ( legal stuff, seriously, believe me :D ) using Transmission Bittorrent client over a VPN connection. Sometimes it happens that the VPN connection fails and doesn't reconnect for whatever reason and Transmission continues pulling stuff directly over my internet connection, which I would like to avoid. Fortunately it is very straightforward to enforce rules based on application owner UID. Transmission runs under the owner debian-transmission in Debian (use htop to check this) and the following two lines of iptables ensures that any process with owner having UID, debian-transmission, will not use any other network interface apart from the OpenVPN tunnel interface tun0

iptables -A OUTPUT -m owner --uid-owner debian-transmission -d 192.168.0.100 -j ACCEPT
iptables -A OUTPUT -m owner --uid-owner debian-transmission \! -o tun0 -j REJECT

The first line ensures that, my Mac-mini having IP address 192.168.0.100 on the lan, can always access the web interface of transmission. The second line makes sure, no outgoing traffic can leave via anything other that tun0. Peace of mind restored, thanks to iptables.

Code

transmission-vpn-only.sh

Ver. ArchLinuxARM-110413

#!/bin/sh

iface="tun0"
service="transmission.service"
config="/var/lib/transmission/.config/transmission-daemon/settings.json"

# test if service is currently running
systemctl --quiet is-active $service
if [ $? -eq 0 ]; then
    # get the ip from the current config
    savedIP=$(cat $config | egrep -o '\"bind-address-ipv4\": \"[^ ]*' | cut -d'"' -f4)
    # test if ip has changed and is no longer available
    ping -i1 -w2 -c1 $savedIP >/dev/null
    if [[ $? -ne 0 || "x$savedIP" == "x0.0.0.0" ]]; then
        echo IP unavailable, stop and reconfigure transmission..
        systemctl stop $service
        # test if VPN went down completely
        ifconfig $iface >/dev/null
        if [ $? -ne 0 ]; then
            echo Oops.. $iface not available, exiting without restarting transmission..
            exit 1
        fi
        # reconfigure transmission with new ip address
        sed -i "s/\"bind-address-ipv4\":.*\$/\"bind-address-ipv4\": \"$(ip a show dev $iface | egrep -o 'inet [^ ]* ' | cut -d' ' -f2 | sed 's/ //')\",/" $config
        systemctl start $service
        echo Transmission started.
    fi
else
    echo "Transmission isn't running.."
    exit 1
fi

To-Do

  • Figure out how to 'BindInterface', if possible.
  • Revise transmission-vpn-only script.
  • Figure out why openvpn config leaves routes behind.

Useful Links and References

  1. BotCyborg

Solidworks Rig

Min Reqs (Win7x64)

CPU     Intel or AMD with SSE2 support. 64-bit OS recommended.
RAM     2GB+
HDD     5GB+
Video   Quadro/QuadroFX/FireGL/FirePro

Notes regarding HW selection

  • FirePro v3900 was best bang for buck. Good Solidworks reviews.
  • 4GB of RAM will work, can always upgrade.
  • 3.5Ghz Dual core + Hyper-Threading (i3-3220/3240) should be plenty.

Capinc Solidworks HW Tips

  • Video Card: VERY important
  • Proc: Solidworks is optimized for multiple cores
  • RAM: Solidworks grabs 340mb on launch. 4gb+ is only necessary for very large assemblies (over 10,000 parts)
  • HD: Generally, does not affect Solidworks performance

Newegg specials for Oct.

"i5" Combo + FirePro V3900 ~$630

Someone mentioned i5 & i7's have decent enough graphics to run Solidworks.. maybe just get FirePro later, if needed?

  • Trustworthy PSU
  • i5 is Quad Core, 8MB-L2, HD4000 'integrated' gfx
  • 8GB RAM
  • 1TB HDD, SSD would've been nicer.
  • USB 3.0
  • No case.

    Combo: 1291151

"i3" Combo + FirePro V3900 ~$ 430

  • Decent PSU. But low wattage.
  • 500GB HDD
  • USB 3.0
  • Plain Case.

    Combo: 1271103

"Budget Gaming" Combo $ 370

  • nVidia GT 640 2GB, instead of FirePro ?
    .. donno if that's such a good idea.
  • Good PSU
  • 500GB HDD
  • USB 3.0
  • Decent looking case.

    Combo: 1461943