Skip to content

Instantly share code, notes, and snippets.

View enricobacis's full-sized avatar

Enrico Bacis enricobacis

View GitHub Profile
from fritzconnection import FritzConnection
import telepot
import re
connection = FritzConnection(password='YOUR_FROTS_PASSWORD')
ip = connection.call_action('WANPPPConnection', 'GetInfo')['NewExternalIPAddress']
match = re.search('^100\.', ip)
if match:
@enricobacis
enricobacis / ltmux
Created February 21, 2017 11:06
lazy tmux
#!/bin/bash
WHOAMI=$(whoami)
if tmux has-session -t $WHOAMI 2>/dev/null; then
tmux -2 attach-session -t $WHOAMI
else
tmux -2 new-session -s $WHOAMI
fi
@hannes-brt
hannes-brt / ipy_hide_input
Created August 12, 2013 00:20
This is a simple command line tool that adds a small snippet of Javascript to the end of the HTML output of `ipython nbconvert` that hides the input code in the output. This works for both '--to html' and '--to slides' The tool works both when given a file name or by reading from stdin: ```bash ipy_hide_input input_file.slides.html ipython nbcon…
#! /usr/bin/env python
"""
The MIT License (MIT)
Copyright (c) 2013 Hannes Bretschneider
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
@mamiu
mamiu / install_fish_debian.sh
Last active November 24, 2018 12:25
Install fish shell in Debian 8 (commands from the original fish shell website).
#!/bin/bash
echo 'deb http://download.opensuse.org/repositories/shells:/fish:/release:/2/Debian_8.0/ /' >> /etc/apt/sources.list.d/fish.list
apt-get update
wget -qO - http://download.opensuse.org/repositories/shells:fish:release:2/Debian_8.0/Release.key | apt-key add -
apt-get update
apt-get install -y fish
@davetrux
davetrux / SQLiteDebugADB
Created March 24, 2014 14:42
Verbose Logging of SQLite statements in Android
adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
adb shell start
@domoritz
domoritz / wos.php
Created March 10, 2012 19:32 — forked from pol/wos.php
Web of Science API access with ruby, python and php libs
<?php
$auth_url = "http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl";
$auth_client = @new SoapClient($auth_url);
$auth_response = $auth_client->authenticate();
$search_url = "http://search.isiknowledge.com/esti/wokmws/ws/WokSearchLite?wsdl";
$search_client = @new SoapClient($search_url);
$search_client->__setCookie('SID',$auth_response->return);
$search_array = array(
SHELL := /bin/bash
YARN := yarn
VENDOR_DIR = assets/vendor/
JEKYLL := jekyll
PROJECT_DEPS := package.json
.PHONY: all clean install update
all : serve
@datagrok
datagrok / gist:2199506
Last active April 8, 2023 17:36
Virtualenv's `bin/activate` is Doing It Wrong
@bfoz
bfoz / fixup_committer_date.sh
Created September 7, 2010 19:24
Force GIT_COMMITTER_DATE = GIT_AUTHOR_DATE
git filter-branch --env-filter 'export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"'
@killercup
killercup / Readme.md
Last active August 26, 2023 23:14
Convert The Rust Programming Language to Epub