get the last commit hash in abbreviated form
git log -n1 --pretty=format:%h
list files in another branch
git ls-files --with-tree=another-branch
import logging | |
import logging.handlers | |
log = logging.getLogger(__name__) | |
log.setLevel(logging.DEBUG) | |
handler = logging.handlers.SysLogHandler(address = '/dev/log') | |
formatter = logging.Formatter('%(module)s.%(funcName)s: %(message)s') |
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
''' | |
This is a quick reference example to get you started with yaml. Please review this, | |
but spend the time to fully read the wikipedia page on yaml: | |
http://en.wikipedia.org/wiki/Yaml | |
Note that the magic quote-less yaml parsing will still always strip values. | |
To avoid this you need to use quotes. Quotes can also force types to string type, | |
and are always valid (meaning omitting quotes is for convenience not necessity). | |
''' |
Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.
As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.
Here's how to get it set up on Mac OS X:
OpenConnect can be installed via homebrew:
brew update
brew install openconnect
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
#!/usr/bin/env python | |
## Tiny Syslog Server in Python. | |
## | |
## This is a tiny syslog server that is able to receive UDP based syslog | |
## entries on a specified port and save them to a file. | |
## That's it... it does nothing else... | |
## There are a few configuration parameters. | |
LOG_FILE = 'youlogfile.log' |
#!/usr/bin/python | |
import os | |
import subprocess | |
import sqlite3 | |
desktop_picture_path = '/Library/Desktop Pictures/Wave.jpg' | |
database_location = os.path.expanduser( | |
'~/Library/Application Support/Dock/desktoppicture.db') |
#!/usr/bin/python | |
'''Uses Cocoa classes via PyObjC to set a random desktop picture on all screens. | |
Tested on Mountain Lion and Mavericks. | |
See: | |
https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html | |
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html |
#!/usr/bin/python | |
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSWorkspace_Class/Reference/Reference.html#//apple_ref/doc/uid/20000391-BCIEBDGB | |
# https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Foundation/Classes/NSURL_Class/Reference/Reference.html | |
# https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSScreen_Class/Reference/Reference.html#//apple_ref/doc/c_ref/NSScreen | |
from AppKit import NSWorkspace, NSScreen | |
from AppKit import NSWorkspaceDesktopImageScalingKey | |
from AppKit import NSImageScaleProportionallyUpOrDown | |
from AppKit import NSWorkspaceDesktopImageAllowClippingKey |