Index:


System Administration

  • Adding a new git repository to my gitosis setup.

    Quick cheatsheet for adding a new git repository under my setup (with gitosis)

    The main reason that I have this note is because this is much simpler than I expect – I always think that it will be much more complex, and so start researching how everything fits together 🙂

     

    1: Add the project / repo to gitosis:

    1.1: Edit the ~/src/configs/gitosis-admin/gitosis.conf:

    [group data]
    members = wkumari wkumari@eric
    writable = data

    1.2: Commit and push the change:

    root@ron[0]:~/src/configs/gitosis-admin# git commit -a -m "Added the 'data' repository"
    [master 9072fe9] Added the 'data' repository
    1 file changed, 4 insertions(+)

    root@ron[0]:~/src/configs/gitosis-admin# git push
    Counting objects: 3, done.
    Delta compression using up to 24 threads.
    Compressing objects: 100% (3/3), done.
    Writing objects: 100% (3/3), 331 bytes | 0 bytes/s, done.
    Total 3 (delta 1), reused 0 (delta 0)
    To git@git.kumari.net:gitosis-admin.git
    7320023..9072fe9 master -> master

    2: Create and push the repo:

    wkumari@ron[0]:~$ mkdir data
    wkumari@ron[0]:~$ cd data/
    wkumari@ron[0]:~/data$ ls
    wkumari@ron[0]:~/data$ touch testfile
    wkumari@ron[0]:~/data$ git init
    Initialized empty Git repository in /home/wkumari/data/.git/
    wkumari@ron[0]:~/data$ git add testfile
    wkumari@ron[0]:~/data$ git commit -a -m "Add a test file"
    wkumari@ron[0]:~/data$ git remote add origin git@git.kumari.net:data.git
    wkumari@ron[0]:~/data$ git push --set-upstream origin master
    Counting objects: 3, done.
    Writing objects: 100% (3/3), 214 bytes | 0 bytes/s, done.
    Total 3 (delta 0), reused 0 (delta 0)
    To git@git.kumari.net:data.git
    * [new branch] master -> master
    Branch master set up to track remote branch master from origin.
    wkumari@ron[0]:~/data$ git push
    Everything up-to-date

    3: Profit!!!

  • Fixing the new Ubuntu grub / VGA console.

    I use Ubuntu on various servers; unfortunately Ubuntu is increasingly aimed more at a consumer desktop audience, and it tries to do things like boot with a pretty, high resolution splash screen, hide the grub screen, etc. This does not work at all well for a server – it fails with the monitors on datacenter crash carts, it fails with many KVMs, DRACs, etc. 

    In order to get back to a more sane console, edit /etc/defaults/grub and make the beginning look like: 

    GRUB_DEFAULT=0
    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
    GRUB_CMDLINE_LINUX_DEFAULT="nosplash xvga=640x480"
    GRUB_GFXMODE=640x480
    GRUB_GFXPAYLOAD_LINUX=keep
    GRUB_CMDLINE_LINUX=""


  • Making OpenVPN Connect Client allow profile import

    OpenVPN Access Server gives users a nice, preconfigured .dmg, which includes a profile for connecting to the server. Unfortunatly this client is configured to be very basic, and does not allow for importing profiles.

    This can be configured from the access-server, but it is often nicer to be able to do this on a per-client basis (with the “basic_client” parameter). This is how to do it on OS X.

    To get status: 
    /Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli GetPreferences

     

    To allow adding profiles:
    /Library/Frameworks/OpenVPN.framework/Versions/Current/bin/capicli -k basic_client -v false SetPreference

  • Installing / reinstalling Dell Openmanage on Ubuntu

    This keeps breaking, with weird unmet dependencies. apt-get-f install, etc seems to become sad. Completely removing and reinstalling seems easiest…

    Getting errors like:

    * Already started
    Processing triggers for libc-bin (2.23-0ubuntu4) ...
    Errors were encountered while processing:
    /var/cache/apt/archives/srvadmin-hapi_8.4.0-1_amd64.deb
    E: Sub-process /usr/bin/dpkg returned an error code (1)

     

    Fixed with:

    apt-get -f purge srvadmin-isvc srvadmin-hapi srvadmin-ominst
    apt-get -f purge srvadmin-storage srvadmin-omacore srvadmin-storage-cli apt-get -f install apt-get update apt-get install srvadmin-isvc srvadmin-hapi srvadmin-ominst
    apt-get install srvadmin-storage srvadmin-omacore srvadmin-storage-cli service dataeng start omreport storage controller
  • ZFS tips and tricks

    Quick notes on creating a ZFS filesystem.

    root@ron:~/src/configs/gitosis-admin# zfs create tank/data/scratch
    root@ron:~/src/configs/gitosis-admin# zfs set quota=10G tank/data/scratch
    root@ron:~/src/configs/gitosis-admin# touch /tank/data/scratch/.duplicity-ignore
    root@ron:~/src/configs/gitosis-admin#

    Creating .duplicity-ignore will prevent Duply (well, Duplicity) from backing up this directory.

     

    Checking the compression ratio:

    zfs get all  | grep compressratio
  • Migrating from SVN to Git

    There are already a number of online instructions on how to do this, but many of them required much reading and assumed specific SVN repo layouts. 

    I used SVN for various small projects, and didn’t follow the standard trunk layout. I also wanted to break up my huge SVN repo into lots of smaller git repos. 

    Here is my cheat sheet:

     # mkdir ansible 
    # cd ansible
    # svn2git svn+ssh://svn.kumari.net/data/svn/my_configs/ansible --trunk / \
    --authors ~/src/code/users.txt --no-minimize-url
    # git remote add origin git@git.kumari.net:config_ansible
    # git push --set-upstream origin master
     
  • Turning a Linux machine into an Ethernet tap.

    Sometimes you need to sniff traffic between two devices, but don’t have a handy Ethernet tab / NetOptics box with you.

    You can simply confugure a machine with 2 NICs (or USB-> Ethernet dongles) to act as a bridge, and then tcpdump the bridge interface:

    set up a transparent bridge:
    brctl addbr br0;
    brctl addif br0 eth1;
    brctl addif br0 eth2;
    ifconfig br0 up;
    tcpdump -n -i br0;
  • Enabling iDRAC 7 web interface.

    I recently ran into an issue with a Dell iDRAC 7 Express card — it was not running the web interface, and so I was not able to connect and install the Enterprise license file.

    Here’s how to fix it:

    Workstation:~ $ ssh 192.168.0.193 -l root
    root@192.168.0.193's password:
    /admin1->
    /admin1-> racadm
    
    racadm>> getconfig -g cfgRacTuning
    cfgRacTuneRemoteRacadmEnable=1
    cfgRacTuneWebserverEnable=0
    cfgRacTuneHttpPort=80
    cfgRacTuneHttpsPort=443
    cfgRacTuneTelnetPort=23
    cfgRacTuneSshPort=22
    cfgRacTuneLocalServerVideo=1
    cfgRacTuneIpRangeEnable=0
    cfgRacTuneIpRangeAddr=192.168.1.1
    cfgRacTuneIpRangeMask=255.255.255.0
    cfgRacTuneIpBlkEnable=1
    cfgRacTuneIpBlkFailCount=3
    cfgRacTuneIpBlkFailWindow=60
    cfgRacTuneIpBlkPenaltyTime=600
    cfgRacTuneTimezoneOffset=0
    cfgRacTuneDaylightOffset=0
    cfgRacTuneAsrEnable=1
    cfgRacTunePlugintype=0
    cfgRacTuneCtrlEConfigDisable=0
    cfgRacTuneLocalConfigDisable=0
    
    racadm>> config -g cfgRacTuning -o cfgRacTuneWebserverEnable 1
    Object value modified successfully
    
    racadm>> getconfig -g cfgRacTuning
    cfgRacTuneRemoteRacadmEnable=1
    cfgRacTuneWebserverEnable=1
    cfgRacTuneHttpPort=80
    cfgRacTuneHttpsPort=443
    cfgRacTuneTelnetPort=23
    cfgRacTuneSshPort=22
    cfgRacTuneLocalServerVideo=1
    cfgRacTuneIpRangeEnable=0
    cfgRacTuneIpRangeAddr=192.168.1.1
    cfgRacTuneIpRangeMask=255.255.255.0
    cfgRacTuneIpBlkEnable=1
    cfgRacTuneIpBlkFailCount=3
    cfgRacTuneIpBlkFailWindow=60
    cfgRacTuneIpBlkPenaltyTime=600
    cfgRacTuneTimezoneOffset=0
    cfgRacTuneDaylightOffset=0
    cfgRacTuneAsrEnable=1
    cfgRacTunePlugintype=0
    cfgRacTuneCtrlEConfigDisable=0
    cfgRacTuneLocalConfigDisable=0
    
  • Adding a user to a group (e.g sudo)

    For some reason I have a hard time remembering the arguments to usermod to add a user to a group. 

    sudo usermod -aG sudo wkumari

  • Ubuntu: Making Dell OpenManage run on newer Ubuntu

    Quick checksheet for making Dell OpenManage install on new Ubuntu’s (like Trusty)

     

    As a user (not root, otherwise gpg complains):
    gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F
    gpg -a --export 1285491434D8786F | sudo apt-key add -

    Now, as root, add the repo to the apt-sources:
    echo 'deb http://linux.dell.com/repo/community/ubuntu trusty openmanage' | sudo tee -a /etc/apt/sources.list.d/linux.dell.com.sources.list

    Now install:
    apt-get update
    apt-get install srvadmin-base  srvadmin-storageservices srvadmin-omcommon

    Start the service:
    service dataeng start

     … and test:
    /opt/dell/srvadmin/bin/omreport chassis fans

     

     Other helpful information:

    A useful Nagios plugin to use this: http://folk.uio.no/trondham/software/check_openmanage.html

    and the Dell page on this: http://linux.dell.com/repo/community/ubuntu/