<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="FeedCreator 1.8" -->
<?xml-stylesheet href="https://biggi.dk/dokuwiki/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://biggi.dk/dokuwiki/feed.php">
        <title>BiggiWiki - bash</title>
        <description></description>
        <link>https://biggi.dk/dokuwiki/</link>
        <image rdf:resource="https://biggi.dk/dokuwiki/lib/exe/fetch.php/wiki/dokuwiki.svg" />
       <dc:date>2026-04-19T15:30:12+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/add_drbd_lvm_kvm_vps?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/apt_notifier?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/backlight_script?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/cisco_phone_scan?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/count_log_entries_per_second?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/disable_synaptics_coasting?rev=1470751212&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/drbd_recovery?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/lvm_snapshot_backup?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/mysql_migrate_server?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/reportspam?rev=1439672202&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://biggi.dk/dokuwiki/lib/exe/fetch.php/wiki/dokuwiki.svg">
        <title>BiggiWiki</title>
        <link>https://biggi.dk/dokuwiki/</link>
        <url>https://biggi.dk/dokuwiki/lib/exe/fetch.php/wiki/dokuwiki.svg</url>
    </image>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/add_drbd_lvm_kvm_vps?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>add_drbd_lvm_kvm_vps</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/add_drbd_lvm_kvm_vps?rev=1439672202&amp;do=diff</link>
        <description>Step 1 - Create an LVM partition for your new VPS - do this on both boxes:

lvcreate -n mcbox -L 5G acerbox

Explanation: Create a partition named 'mcbox' on volume 'acerbox' with the size of 5GB - Find your own volume name with 'pvdisplay'

Step 2 - Edit the drbd conf (you should probably create a ressource file instead of using the flatfile like I do) - do this on both boxes:</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/apt_notifier?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>apt_notifier</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/apt_notifier?rev=1439672202&amp;do=diff</link>
        <description>#!/bin/bash
#
# Cron Script - run from /etc/crontab or /etc/cron.daily
#
# Runs &quot;apt-get update&quot; and prints the output of a simulated
# dist-upgrade if new packages are found.

apt-get update 2&gt;&amp;1 &gt; /dev/null
if [[ &quot;`apt-get --simulate dist-upgrade 2&gt;&amp;1 | grep Inst | wc -l`&quot; != &quot;0&quot; ]]; then
        apt-get --simulate dist-upgrade
fi</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/backlight_script?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>backlight_script</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/backlight_script?rev=1439672202&amp;do=diff</link>
        <description>I had some issues getting the onboard light control working with openbox, so I just downloaded xbacklight and wrote a quick script to control it. ALT + F8/F9.

Debug crap and everything, it's all there. Enjoy :P

Examples:
/usr/bin/backlight dec
/usr/bin/backlight inc
(that's about it)</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/cisco_phone_scan?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>cisco_phone_scan</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/cisco_phone_scan?rev=1439672202&amp;do=diff</link>
        <description>A simple script I wrote to scan our IP phone range at work so I know which number is where (for my click-to-dial script). I don't have access to the callmanager, hence I'm doing it like this.


COUNT=10
TIMEOUT=5
# Range goes from 10-253
while [ $COUNT -lt 254 ]; do
	TMPOUT=`lynx -connect_timeout=$TIMEOUT -dump http://192.168.222.$COUNT 2&gt; /dev/null | egrep &quot;Phone DN|Host Name&quot;`
	if [ ${#TMPOUT} -gt 30 ]; then
# Debug sheit (or whatever, shuddap! :D), output the time.
		echo -n &quot;`date +%T` - &quot;
	…</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/count_log_entries_per_second?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>count_log_entries_per_second</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/count_log_entries_per_second?rev=1439672202&amp;do=diff</link>
        <description>I wanted to see how much traffic my webserver got because I suddenly got a spike in web hits. I found a couple of scripts, but I generally disliked them, as they all used “cat” or “wc”, which is quite heavy when you have a couple of million lines. That would mean spending a lot of time looping the same log file. Instead we can tail it.</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/disable_synaptics_coasting?rev=1470751212&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2016-08-09T14:00:12+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>disable_synaptics_coasting</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/disable_synaptics_coasting?rev=1470751212&amp;do=diff</link>
        <description>To disable the very annoying feature that keeps scrolling even after you let go of the touchpad, run the following command:


synclient CoastingSpeed=0


Instead of “Coasting”, I vote that the feature is renamed to “Drunk emulator”.

Source:</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/drbd_recovery?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>drbd_recovery</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/drbd_recovery?rev=1439672202&amp;do=diff</link>
        <description>DRBD node failure recovery.

Step 1 - Set all drbd volumes as secondary to avoid incidents + invalidate all data

@BROKEN BOX


drbdadm secondary all
drbdadm invalidate all


(Instead of 'all', you can of course use drbd0, drbd1 etc.)

Step 2 - Overwrite data of the other peer (</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/lvm_snapshot_backup?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>lvm_snapshot_backup</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/lvm_snapshot_backup?rev=1439672202&amp;do=diff</link>
        <description>A backup script I created some years ago and still use for different projects.

It's a combined tar'ing + LVM snapshot script. It'll read /var/backup/backuplist for a list of backup-dirs and /var/backup/excludelist for a list of excludes (e.g. include /var/www but exclude /var/www/cache).</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/mysql_migrate_server?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mysql_migrate_server</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/mysql_migrate_server?rev=1439672202&amp;do=diff</link>
        <description>I needed to move an SQL server. As always I started out doing a small run'n'delete-script, but I decided to go all in and make it a bit user friendly and all that.
The script grabs current users and packs them in a query. Then it dumps all the db's with mysqldump and imports it on the other machine via. SSH.
Run the script on the machine you want to move FROM. Make sure that sshpass, mysqldump and pigz/gzip is installed. (Pigz = multicore gzip)</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/reportspam?rev=1439672202&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2015-08-15T20:56:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>reportspam</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/reportspam?rev=1439672202&amp;do=diff</link>
        <description>Quick script I wrote to fetch spam-mails from users junk folders.


#!/bin/bash

# Report all mails as spam from the junk folders of every user.
# Only take mails from cur, as new is unread and we don't want to report unread messages (right?)

# Initial vars and stuff
SPAMCOUNT=0

for x in `ls -d /var/vmail/vmail01/*/*/Maildir/.Junk/cur/`; do

# Reset spam counter for each loop
        UCOUNT=0
        UCOUNT=`ls $x | wc -l`

# Fetch username + domain from path
        UDOMAIN=`echo $x | cut -f5…</description>
    </item>
</rdf:RDF>
