Skip to content

Instantly share code, notes, and snippets.

View sweinberg's full-sized avatar

swein sweinberg

View GitHub Profile
#!/bin/bash
# export DBUS_SESSION_BUS_ADDRESS environment variable because cron hates me
PID=$(pgrep -u USER gnome-session-b)
export DBUS_SESSION_BUS_ADDRESS=$(grep -z DBUS_SESSION_BUS_ADDRESS /proc/$PID/environ|cut -d= -f2-)
/usr/bin/gsettings set org.gnome.shell.extensions.user-theme name 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.interface gtk-theme 'Flat-Plat'
/usr/bin/gsettings set org.gnome.desktop.background picture-uri 'file://WALLPAPER-PATH'
/usr/bin/gsettings --schemadir ~/.local/share/gnome-shell/extensions/[email protected] set org.zzrough.gs-extensions.drop-down-terminal background-color 'rgb(69,90,100)'
@kevcooper
kevcooper / ABMultiredditGenerator.py
Last active December 8, 2015 01:27
A python script to transform a list of subreddits in the clipboard into a paste-able format to be used in an Alien Blue group. Copy the list from your multireddit, run the script in Pythonista, then create a new group in Alien Blue and paste. Thats it!
import console
import clipboard
import webbrowser
def main():
text = clipboard.get()
noNewlines = text.replace('\n',' ')
array = noNewlines.split(' ')
ABString = finalStringFromArray(array)
clipboard.set(ABString)
@Moving-Electrons
Moving-Electrons / ssh_command.py
Last active February 19, 2022 21:01
This script connects through SSH to the Computer/Server using the Username & Password defined in the header. It then runs a command/script that is passed as an argument by long pressing the Run icon in Pythonista or by calling the script through Pythonista's URL scheme with an argument. More information in www.movingelectrons.net , scripting sec…
import paramiko
import console
import sys
import keychain
'''This script connects through SSH to the Computer/Server using the Username & Password defined in the header.
It then runs a command/script that is passed as an argument by long pressing the Run icon in Pythonista or by
calling the script through Pythonista's URL scheme with an argument.
General Notes:
@stophlong
stophlong / pythonista_google_tts.py
Created February 2, 2014 19:28
Ios 7 pythonista script: takes clipboard (in Spanish) and reads it aloud (in Spanish) using Google Text to Speech
# -*- coding: utf-8 -*-
""" ios clipboard to google TTS (in Spanish)
This was written for ios pythonista, a python 2.x language. It takes whatever is in the clipboard
and reads it out using google text-to-speech. The present form takes Spanish and reads it aloud as my
interest is in learning to understand spoken Spanish. I take text from the immersion part of
Duolingo and listen. It should be quite easy to modify for different purposes.
On a jail-broken device one can even: copy to clipboard, use activator to launch the pythonista script, and
have it start speaking! I simple gathered some python from the web, fit it together, debugged a bit, and I
had a new tool. Pythonista blew my mind.
@0xabad1dea
0xabad1dea / rsa-not-buying-it.md
Last active May 4, 2022 21:59
Sorry, RSA, I'm just not buying it

Sorry, RSA, I'm just not buying it

I want to be extremely clear about three things. First, this is my personal opinion – insert full standard disclaimer. Second, this is not a condemnation of everyone at RSA, present and past. I assume most of them are pretty okay, and that the problem is confined to a few specific points in the company. However, “unknown problem people making major decisions at RSA” is a bit unwieldy, so I will just say RSA. Third, I'm not calling for a total boycott on RSA. I work almost literally across the street from them and I don’t want to get beat up by roving gangs of cryptographers at the local Chipotle.

RSA's denial published last night is utter codswallop that denies pretty much everything in the world except the actual allegations put forth by Reuters and hinted at for months by [other sources](http://li

@b1nary
b1nary / Altcoin Watcher.md
Last active May 6, 2023 23:16
Altcoin watcher is a Cryptocoin watcher written in Ruby utilizing the Cryptsy API

Altcoin Watcher (Cryptsy)

Version 0.1.2

This script allows you to keep an process running which shows you current prices for the Altcoins you like. Also it shows % and revenue in BTC or $ if configured. Feel free to use or modify the script. If you make some nice changes i would be happy if you send them back to me too.

Made with love

I created this options friendly because i think others might need it too. Show me your support with a little tip!

  • Cryptsy Trading key: 26b13a60f5cd3aa78e4c29328fb9980bef963e9e
@omz
omz / ShortcutGenerator.py
Created December 9, 2013 11:01
ShortcutGenerator
# This script adds a "Webclip" shortcut to your homescreen.
# The shortcut can be used to open a web page in full-screen mode,
# or to launch a custom URL (e.g. a third-party app).
# You'll be asked for a title, a URL, and an icon (from your camera roll)
import plistlib
import BaseHTTPServer
import webbrowser
import uuid
from io import BytesIO
@kentbrew
kentbrew / RedditTipButton.md
Last active December 29, 2015 21:09
Invite your readers to leave you a Bitcoin tip on Reddit

###Invite your readers to leave you a Bitcoin tip on Reddit

Reddit's Bitcoin implementation is ideal for beginners. Here's how to get them to give it a try.

####Structure

@grantslatton
grantslatton / hngen.py
Last active September 27, 2021 11:07
A program that uses Markov chains to generate probabilistic Hacker News titles.
import urllib2
import re
import sys
from collections import defaultdict
from random import random
"""
PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS
NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE
CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt"
@ttscoff
ttscoff / wakeup.sh
Created November 12, 2013 21:30
Wake remote Mac on local network
#!/bin/bash
if [[ $1 =~ ((mb)?air|pibble) ]]; then
target="pibble.local"
else
target="macpro.local"
fi
ping -c 1 $target &> /dev/null