Skip to content

Instantly share code, notes, and snippets.

View WalterS's full-sized avatar

Walter S. WalterS

  • SAP SE
View GitHub Profile
#!/bin/env python
import os, re, requests
site = 'http://download.opensuse.org/repositories/devel:/languages:/haskell:/lts:/6/openSUSE_Backports_SLE-12-SP2/x86_64/'
response = requests.get(site)
if response.status_code == 404:
raise Exception('Website not available, HTTP response code: ' + str(response.status_code))
@WalterS
WalterS / unob_spiegelplus.js
Last active May 11, 2017 08:58 — forked from trent2/unob_spiegelplus.user.js
Unobfuscate Spiegel Plus articles with Greasemonkey
// ==UserScript==
// @name unobfuscate spiegel plus
// @namespace obfuscate
// @include http://www.spiegel.de/*
// @version 1
// @grant none
// ==/UserScript==
var obfcontdiv = document.getElementsByClassName('obfuscated-content');
obfcontdiv[0].setAttribute("class", "");
var elems = document.getElementsByClassName('obfuscated'), t, or, c, i, cc;
@WalterS
WalterS / example.txt
Last active February 23, 2016 09:01
Useless use of grep etc.
Bad examples:
http://colby.id.au/finding-the-local-ip-address-with-ifconfig-and-sed/
http://www.cyberciti.biz/tips/read-unixlinux-system-ip-address-in-a-shell-script.html
Better:
All except loopback:
ip -o a | awk -F': +| +|/' '$2 != "lo" {print $4}'
Just eth0:
ip -o a | awk -F': +| +|/' '$2 == "eth0" {print $4}'
@WalterS
WalterS / netio230a_bash-expect.tcl
Created April 10, 2011 18:04 — forked from pklaus/netio230a.cpp
Script for NETIO power controller
#!/usr/bin/expect
############################################################
# Script for NETIO power controller
# Disables/enables watchdog on port $netio_port
#
# WS 20110317
# Found on <http://koukaam.se/forum/viewthread.php?forum_id=33&thread_id=1752#3667>
############################################################
######## Changes ########