Skip to content

Instantly share code, notes, and snippets.

View sashkab's full-sized avatar

Aleks Bunin sashkab

View GitHub Profile
@lisamelton
lisamelton / transcode-video.sh
Last active May 24, 2024 17:42
Transcode video file (works best with Blu-ray or DVD rip) into MP4 (or optionally Matroska) format, with configuration and at bitrate similar to popular online downloads.
#!/bin/bash
#
# transcode-video.sh
#
# Copyright (c) 2013-2015 Don Melton
#
about() {
cat <<EOF
$program 5.13 of April 8, 2015
@Andrewpk
Andrewpk / OSX-junos_pulse_listenToMe.sh
Last active April 16, 2022 03:01
wtf juniper. Anyone else find it irritating that junos pulse services and pulse tray must always running in OS X regardless of whether or not you're currently connected? Yeah, me too. I added the following as aliases to my shell to fix this problem. Be sure to change your /Library/LaunchAgents/net.juniper.pulsetray.plist file to reflect the `Kee…
#################################################################################
# start and stop the vpn from the command line from now on with these two commands
# or rename the aliases as you see fit.
#################################################################################
alias startvpn="sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist; open -a '/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray'"
alias quitvpn="osascript -e 'tell application \"PulseTray.app\" to quit';sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist"
@chengyin
chengyin / linkedout.js
Last active July 11, 2021 15:23
Unsubscribe all LinkedIn email in "one click". For an easier to use version, you can check out the bookmarklet: http://chengyin.github.io/linkedin-unsubscribed/
// 1. Go to page https://www.linkedin.com/settings/email-frequency
// 2. You may need to login
// 3. Open JS console
// ([How to?](http://webmasters.stackexchange.com/questions/8525/how-to-open-the-javascript-console-in-different-browsers))
// 4. Copy the following code in and execute
// 5. No more emails
//
// Bookmarklet version:
// http://chengyin.github.io/linkedin-unsubscribed/
@benubois
benubois / send_system_stats.sh
Created July 30, 2013 17:58
This requires that `ifstat`, `sysstat` and `bc` are installed and that `$LIBRATO_USER` and `$LIBRATO_TOKEN` are available in the environment.
#!/bin/bash
hostname=$(hostname)
# Run top twice, first output is cached
top_out=$(top -bn2 -d0.1)
cpu=$(echo "${top_out}" | grep "Cpu(s)" | sed -E "s/.*,\s*([0-9\.]+)\%id.*/\1/" | awk '{print 100 - $1}' | sed -n 2p)
memory_total=$(echo "${top_out}" | grep "Mem:" | awk {'print $2'} | sed s/k// | sed -n 2p)
@asfaltboy
asfaltboy / log_test12.py
Last active August 24, 2019 05:50 — forked from anonymous/log_test11.py
Test harness for the logging module. Tests BufferingSMTPHandler, an alternative implementation SMTPHandler. This fork includes credential and secure support (as implemented in newer versions of logging library). Additionaly a flood check is implemented to make sure not more than capacity per minute is sent, otherwise the capacity (buffer) is rai…
#!/usr/bin/env python
#
# Copyright 2001-2002 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permission notice appear in
# supporting documentation, and that the name of Vinay Sajip
# not be used in advertising or publicity pertaining to distribution
@ttscoff
ttscoff / grab links.bookmarklet
Last active May 23, 2024 19:21
Create a bookmark and paste the code from `grab links.bookmarklet` into the url. Trigger it on a page containing links you want to save and then click the section of the page containing the links. A Markdown list of all links will be generated, and clicking the resulting list will select all for copying.
@umputun
umputun / pi-radio-mpd.py
Last active October 7, 2018 21:28
pi-radio-mpd - my simple wrapper for mpd to serve rest/json kind of api. working just fine on my RPi.
#!/usr/bin/python
# -*- coding: utf-8 -*-
import web, json, time, mpd, collections
STATIONS = {
"FoxNews" : "mmsh://209.107.209.181:80/D/138/13873/v0001/reflector:24137?MSWMExt=.asf",
"Classic" : "http://radio02-cn03.akadostream.ru:8100/classic128.mp3",
"Jazz": "http://streaming208.radionomy.com:80/A-JAZZ-FM-WEB"
}
<!DOCTYPE html>
<html>
<head>
<title>Radio RPi</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.css"/>
<script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.2.0/jquery.mobile-1.2.0.min.js"></script>
</head>
<body>
@aaronzirbes
aaronzirbes / gist:3239033
Created August 2, 2012 17:43
brew doctor and libmacfuse/libosxfuse
If you see...
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libmacfuse_i32.2.dylib /usr/local/lib/libmacfuse_i64.2.dylib /usr/local/lib/libosxfuse_i32.2.dylib /usr/local/lib/libosxfuse_i64.2.dylib
Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
@cowboy
cowboy / create_108_usb_install.sh
Created July 29, 2012 13:33
bash: Create a 10.8 "USB Install Stick" from InstallESD.dmg
#!/bin/bash
# Before running this script, open Disk Utility.
#
# Partition USB Stick:
# * 1 Partition
# * Options -> GUID Partition Table
# * Mac OS Extended (Journaled)
# * Name: Foobar
#