Skip to content

Instantly share code, notes, and snippets.

View somian's full-sized avatar

Sören Andersen somian

  • toolsmith, independent contractor: python, perl, unix shell; systems admin
  • A city near the eastern Great Lakes, USA
View GitHub Profile
@somian
somian / diamond-farsight.txt
Created December 5, 2015 18:28
CULTIVATE A NEW COMMON SENSE - MY-DFI-AMERICA
Buddhism is so tremendously farsighted and profound a religion that, externally, it is difficult to grasp its true message. People with little understanding of Buddhism can no more discern its value than a child can understand the real value of a diamond. However, please be confident that the develpment of human wisdom will prodce and increasing body of evidence ponting to the greatness of Buddhism.
p11 CULTIVATE A NEW COMMON SENSE - MY-DFI-AMERICA
@somian
somian / LoadUserXmap.py
Created October 11, 2015 20:50
xkb configuration is too complicated - xmodmap script
#!/usr/bin/env python
# Adapted from Andrey Tataranovich script www.tataranovich.com/public/scripts/xkbmapd.py
# to load the user .Xmodmap file on 1) start, 2) resume and 3) layout switch
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@somian
somian / rapido-por-favor.sh
Last active September 10, 2015 10:55
Seeking source pks for Perl mods
**SAMPLE DATA**
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31-1.dsc' libio-pager-perl_0.31-1.dsc 2172 MD5Sum:cc0a1cf20db9392ee2aff6b1906a022e
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31.orig.tar.gz' libio-pager-perl_0.31.orig.tar.gz 15406 MD5Sum:727579dccdda96cfcadbba9def8af59f
'ftp://debian.osuosl.org/debian/pool/main/libi/libio-pager-perl/libio-pager-perl_0.31-1.debian.tar.xz' libio-pager-perl_0.31-1.debian.tar.xz 1556 MD5Sum:b493791b1c60db8d1715be81baaf8484
@somian
somian / NetWhere.bash.sh
Created September 6, 2015 05:40
What works for me Get IP assigned to wlan0 on LinuxMint
Wlan_ip () {
# Get ip assigned to wlan0 interface if it is up.
nmcli --pretty con status uuid 'ac868f68-fd04-41c2-ac0e-2ff40fd71b7c' |
cut -d ':' -f2 |
awk '/ip_address/{print $3}' |tee /tmp/w0ip
}
NetWhere () {
case "$(nmcli --terse --fields device,state dev status|grep --color=never wlan0)" in
@somian
somian / ShAss.md
Last active May 1, 2016 16:46
Annoyware experience: ShoppingAssistant

Google Chrome on GNU/Linux infected by extension

Probably "YouTube Video Downloader for Crome" or "Chrome YouTube Downloader"

It is freeware (free as in "a filthy beer bottle with drowned insects inside") I removed this as soon as I identified it as the probable culprit -- and so far, no more Shopping Assistant.

The odd thing is that Shopping Assistant only activated upon visiting certain sites and, amazingly, a site for a local Indian Restaurant (India Jewel in Kenmore NY) seems to be one (hacked server?)

@somian
somian / OneShotSet.ps1
Created March 20, 2015 07:48
PS launcher for Vim (on Wyhnnows) that finds alternate personal rcfile location
# /Call it OneShotSet.ps1 if you want/
Push-Location
Set-Location HKCU:\Console
New-Item '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'
Set-Location '.\%SystemRoot%_system32_WindowsPowerShell_v1.0_powershell.exe'
# Not working to change after the initial setup ...
## midnightblue -ish behind light gold
New-ItemProperty . ColorTable00 -type DWORD -value 0x00281100
New-ItemProperty . ColorTable07 -type DWORD -value 0x004895c5
New-ItemProperty . FaceName -type STRING -value "Lucida Console"
@somian
somian / CallerScript.cmd
Last active August 29, 2015 14:17
Problem with output
@ECHO OFF
:: Use PS to split env PATH into separated pathelements
:: Run test in Vim :!%:p:h:8/%:r.%:e
POWERshell -File .\Tighties.ps1
:EOF
@somian
somian / picturewindowscrape
Last active August 29, 2015 14:15
picture-window-scrape
#!/bin/bash
# picturewindowscrape
# Global:
SDIMS=2480x1600
# See if we are provisioned up.
for MYEXE in xvfb-run x11vnc vncviewer pstree pgrep
do if [[ -n $(which "$MYEXE") ]]
then :
@somian
somian / playll
Created December 27, 2014 06:16
playlist to filename listing (media files)
perl -MURI::Encode=uri_decode -MFile::Spec::Functions=:ALL -MFile::stat -wne 'if(/([.][.]\/.+\.\w\S+)[<]/){$y=uri_decode($1);$d=stat($y);next if!$d; printf "%s %s\n",$d->ino(),rel2abs($y); }' < HI-Light.xspf
@somian
somian / collectrix
Created December 8, 2014 05:48
windows netwrk adapters
#!perl
use PerlIO;
use strict;
use warnings;
my $PSF;
my $networkshellcmd = q[netsh];
my @networkshellpar = qw[-c lan show interfaces];
my @startprocess = ($networkshellcmd, @networkshellpar);