<?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:one_liners</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:34:34+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/find_last_day_of_the_month?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/migrate_all_libvirt_machines_to_other_host?rev=1439672202&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/mysql_queries_per_second?rev=1511429262&amp;do=diff"/>
                <rdf:li rdf:resource="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/ping_packet_loss?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/one_liners/find_last_day_of_the_month?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>find_last_day_of_the_month</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/one_liners/find_last_day_of_the_month?rev=1439672202&amp;do=diff</link>
        <description>I needed to find the date of the last Sunday in the current month in relation to a backup script. This is the result:


ncal -h 2&gt;&amp;1 | awk '/Su/ {print $(NF)}'


Change “Su” to “Mo” “Tu” or any other day of the week to find the last of that day in the current month</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/migrate_all_libvirt_machines_to_other_host?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>migrate_all_libvirt_machines_to_other_host</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/one_liners/migrate_all_libvirt_machines_to_other_host?rev=1439672202&amp;do=diff</link>
        <description>To migrate all running VPSes to another host, do the following:


for x in `virsh list | grep running | awk {'print $2'}`; do echo &quot;Migrating $x&quot;; virsh migrate-setspeed $x --bandwidth 1000 &amp;&amp; virsh migrate $x qemu+ssh://USERNAME@HOSTNAME/system; sleep 10; done</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/mysql_queries_per_second?rev=1511429262&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2017-11-23T09:27:42+00:00</dc:date>
        <dc:creator>Anonymous (anonymous@undisclosed.example.com)</dc:creator>
        <title>mysql_queries_per_second</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/one_liners/mysql_queries_per_second?rev=1511429262&amp;do=diff</link>
        <description>Oneliner:


LASTVAL=0; CURRVAL=0; while true; do CURRVAL=`mysqladmin status | awk {'print $6'}`; echo &quot;QPS: $((CURRVAL-LASTVAL))&quot;; LASTVAL=$CURRVAL; sleep 1; done


Output example:


[root@thismachine ~]# LASTVAL=0; CURRVAL=0; while true; do CURRVAL=`mysqladmin status | awk {'print $6'}`; echo &quot;QPS: $((CURRVAL-LASTVAL))&quot;; LASTVAL=$CURRVAL; sleep 1; done
QPS: 11429108706
QPS: 8047
QPS: 7783
QPS: 7909
QPS: 9965
QPS: 9835
^C</description>
    </item>
    <item rdf:about="https://biggi.dk/dokuwiki/doku.php/bash/one_liners/ping_packet_loss?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>ping_packet_loss</title>
        <link>https://biggi.dk/dokuwiki/doku.php/bash/one_liners/ping_packet_loss?rev=1439672202&amp;do=diff</link>
        <description>while true; do ping -c 10 8.8.8.8 | grep &quot;packet loss&quot;; sleep 1; done


Example:


biggi@box:~$ while true; do ping -c 10 8.8.8.8 | grep &quot;packet loss&quot;; sleep 1; done
10 packets transmitted, 10 received, 0% packet loss, time 9013ms
10 packets transmitted, 10 received, 0% packet loss, time 9010ms
10 packets transmitted, 10 received, 0% packet loss, time 9013ms
^C
biggi@box:~$</description>
    </item>
</rdf:RDF>
