Tag Archives: Linux

Clear ARP / Neighbour cache on Linux

Posted on .

I am trying to diagnose why out-of-scope ARP requests are being sent (ARP requests for addresses that should be on the default gateway). I thought I had figured it out, but my ARP table was still full of 100’s of incomplete entries. “arp -d” just marks an entry as incomplete, so does “ip neigh del“. I wanted to flush the entire cache.

What finally worked was to flip ARP on/off.

Modifying an initrd

Posted on .

Extract

Recreate

XoloMiner Linux Install Script

Posted on .

I’ve written an install script for Xolo’s PrimeCoin Pool Miner XoloMiner on my new favourite coin, PrimeCoin (XPM).

This makes the miner ready to use at beeeeer.org, or any other pool that supports XoloMiner.

This is still a work in progress, but the install script itself is complete. So far it has been created only for Debian Wheezy as this is the distro I have been using.

$ ./xolominer

Usage: ./xolominer {start|stop|restart|force-reload|status|install|uninstall}

This script will do the following:

  • Install pre-requisites
  • Compile from latest GitHub source
  • Add user/group
  • Init script
  • Log to /var/log/xolominer
  • Crontab entries for auto-restart and log rotate
  • Set to run at boot
  • Uses /etc/xolominer/xolominer.conf as list of pools to loop through (failover)
  • Command “status” for pool and chains per day rate (can be used in Nagios/Zabbix)
  • Command “uninstall” to remove all files except config at /etc/xolominer

I made this as I have access to a few Debian machines and wanted to be able to quickly and easily install the miner without having to perform it all manually. I also needed a reason to code some more bash 🙂

I actually have similar scripts for installing cpuminer, cgminer and bfgminer but this script has been tested the most and is worthy of public attention, enjoy 🙂

Updated 2014-05-12
Updated build method
Renamed to XoloMiner

Note: When updating, uninstall old version and copy /etc/primeminer/primeminer.conf to /etc/xolominer/xolominer.conf

Download
  xolominer.sh (13.3 KiB, 1,877 hits)

Download (old version)
  primeminer.sh (12.3 KiB, 2,077 hits)

Happy mining!

How to use:
wget -q https://nooblet.org/blog/download/xolominer.sh;
chmod +x xolominer.sh;
sudo ./xolominer.sh install;

Installer output:
primeminer_install
Uninstaller output:
primeminer_uninstall

Compile Owncloud libocsync0 for Debian Wheezy from source

Posted on .

I was trying to get the Python Owncloud CLI package to work on Wheezy. It requires libocsync0 which is available in unstable but it has many depends that would push the box further into unstable than I would of liked (samba and sftp plugins require unstable versions of samba, ssh, libc6, etc.).

To get libocsync working on wheezy, I did the following:

logcheck — various filters


As mentioned earlier, I have a few of these logcheck filters I have created over the past few years. I use Debian and CentOS so other distros may not perfectly match.

These work in conjunction with the default filters, hence their naming scheme of local_<service>.

Dovecot
login, logout, mysql connections, lda delivery, ssl regen

  local_dovecot (1.5 KiB, 2,023 hits)

Managesieve (part of Dovecot)
login, logout

  local_managesieve (320 bytes, 1,982 hits)

OpenVPN
login related

  local_openvpn (506 bytes, 1,974 hits)

PostFWD
statistic log lines: dnsbl, rules, stats, cache, rate

  local_postfwd (104 bytes, 1,947 hits)

ProFTPd mod_ban (optional module)
obtained, detached, removed, showing ban list

  local_proftpd-banlog (230 bytes, 1,790 hits)

rSYSlog
start, exit, reload/hup, mark

  local_rsyslog (954 bytes, 1,911 hits)

OpenSSH
closed user request, closed preauth 127.0.0.1

  local_ssh (255 bytes, 2,012 hits)

swapspace
allocating, retiring, adding (kernel)

  local_swapspace (324 bytes, 1,954 hits)