Skip to content

Instantly share code, notes, and snippets.

curl -u admin -k -d command=poweroff -d shutdown_option=1 -d OPERATION=set -d PAGE=System -d OUTER_TAB=tab_shutdown -d INNER_TAB=none https://{$1}/get_handler|awk -F"message>" '{print $2}'|awk -F"</" '{print $1}'
or
curl -u admin:netgear1 -k -d command=poweroff -d shutdown_option=1 -d OPERATION=set -d PAGE=System -d OUTER_TAB=tab_shutdown -d INNER_TAB=none https://10.20.0.102/get_handler
or
curl -u $user:$pass -k "https://$host/admin/index.cgi?CURRENTTAB=Shutdown&CURRENTPAGE=System&MODE=Advanced&button=Current&command=poweroff&MODIFIED=1" >/dev/null 2>/dev/null
@matagus
matagus / opml.xml
Created March 13, 2014 10:31
planetdjango.org opml file listing all its feeds
<?xml version="1.0"?>
<opml version="1.1">
<head>
<title>Planet Django</title>
<dateModified>Sat, 08 Mar 2014 20:57:35 +0000</dateModified>
<ownerName>Adomas Paltanavičius</ownerName>
<ownerEmail>[email protected]</ownerEmail>
</head>
<body>
@gruber
gruber / Liberal Regex Pattern for Web URLs
Last active April 22, 2025 16:56
Liberal, Accurate Regex Pattern for Matching Web URLs
The regex patterns in this gist are intended only to match web URLs -- http,
https, and naked domains like "example.com". For a pattern that attempts to
match all URLs, regardless of protocol, see: https://gist.github.com/gruber/249502
# Single-line version:
(?i)\b((?:https?:(?:/{1,3}|[a-z0-9%])|[a-z0-9.\-]+[.](?:com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|s
@mlgill
mlgill / DropboxSync.py
Last active February 12, 2019 18:11 — forked from wrenoud/DropboxSync.py
DropboxSync: iOS (Pythonista), synchronizes all files to/from Dropbox directory
import os, sys, pickle, console, re
sys.path += ['lib']
import dropboxsetup
# dropbox_sync
# by Michelle L. Gill, [email protected]
# requires my dropboxsetup module (https://gist.github.com/8311046)
# Change log
@ger-
ger- / chaining-lessn-tweetbot.py
Created December 4, 2013 20:08
chaining-lessn-tweetbot: Clicking this (javascript:window.location='pythonista://chaining-lessn-tweetbot?action=run&argv='+encodeURIComponent(document.location.href);) bookmarklet will launch this pythonista script to grab the webpage url and use Lessn to shorten it and then launch compose dialog of Tweetbot with the shortened url. Note: add you…
import webbrowser
import clipboard
import urllib
import sys
import console
import urllib2
l = sys.argv
link=l[1]
lessn='http://'yourdomain'/'x'/-/?api='API key'&url='
link=urllib.quote(link,safe='')
@frank4565
frank4565 / MultipleLineOmniFocus.py
Last active March 25, 2018 08:15
Send Multiple Tasks to OmniFocus at Once with Drafts and Pythonista or one task with Launch Center Pro. Supported Chinese. (Other Unicode characters should also work.)
# -*- coding: utf-8 -*-
# More information: Send Multiple Tasks to OmniFocus at Once with Drafts and Pythonista or one task with Launch Center Pro. Supported Chinese. (Other Unicode characters should also work.)
# Script name: MultiLineOmniFocus
# Drafts "URL Action": pythonista://MultiLineOmniFocus?action=run&argv=[[draft]]%0Adrafts
# Launch Center Pro: pythonista://MultiLineOmniFocus?action=run&args={{[prompt:New Item]}}%0Alaunchpro
# or Install from http://launchcenterpro.com/tdp7fb
# Modified from email script by OMZ: ImageMail
# Modified from script by @Thinkbond from Zhihu.com (http://www.zhihu.com/question/20888606/answer/17093178)
# Inspired by http://n8henrie.com/2013/03/send-multiple-tasks-to-omnifocus-at-once-with-drafts-and-pythonista
@mwhite
mwhite / git-aliases.md
Last active May 10, 2025 04:07
The Ultimate Git Alias Setup

The Ultimate Git Alias Setup

If you use git on the command-line, you'll eventually find yourself wanting aliases for your most commonly-used commands. It's incredibly useful to be able to explore your repos with only a few keystrokes that eventually get hardcoded into muscle memory.

Some people don't add aliases because they don't want to have to adjust to not having them on a remote server. Personally, I find that having aliases doesn't mean I that forget the underlying commands, and aliases provide such a massive improvement to my workflow that it would be crazy not to have them.

The simplest way to add an alias for a specific git command is to use a standard bash alias.

# .bashrc
@aras-p
aras-p / preprocessor_fun.h
Last active May 3, 2025 13:47
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@JamoCA
JamoCA / ExcelFindNext.ahk
Created July 26, 2013 15:41
AutoHotKey script to remap Excel's SHIFT+F4 "Find Next" to simply F3 (same as defunct Adobe HomeSite+, the IDE I'm still using.)
#IfWinActive ahk_class XLMAIN
F3::+F4
#IfWinActive
@JamoCA
JamoCA / DedupeUniqueColumn.ahk
Created July 26, 2013 15:39
AutoHotKey script to sort and removed duplicate values from a column of data (ie, column of values from a spreadsheet). (CTRL+SHIFT+U)
SANITIZE: ;sanitize characters (optional, see below)
AutoTrim,Off
StringCaseSense,On
StringReplace,string,string,chr(160),A_Space,All ;Non-breaking space
StringReplace,string,string,–,-,All ;emdash
StringReplace,string,string,´,',All
StringReplace,string,string,’,',All
StringReplace,string,string,©,(C),All
StringReplace,string,string,“,",All ;left quote
StringReplace,string,string,”,",All ;right quote