Skip to content

Instantly share code, notes, and snippets.

@com30n
com30n / VPNConnect.scpt
Created April 1, 2021 09:29
Automatically connect to the Tunnelblick with MFA password
-- First of all: you have to connect to the vpn with Tunnelblick without,
-- paste your username, set a checkbox "Save in Keychain" for username,
-- paste your password and DO NOT set "Save in Keychain" for the password.
-- Then click "OK" button, connect to the vpn and since this moment you can use the script.
-- 1. To authorize via Touch ID you must apply this script: https://gist.github.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70
-- 2. Create a new password entry in Keychain Access called "tunnelblick-vpn-2f" with your MFA base32 token
-- 3. Add your a new connection name entry in Keychain Access called "tunnelblick-connection-name" with your name of the tunnelblick connection
-- 4. Install oath-toolkit. (brew install oath-toolkit)
-- 5. Open this script in Script Editor (both this and the above are in the Applications->Utilities folder) and "Save as.." an Application (.app) with desired name.
@tatoosh
tatoosh / Mediakeys.ahk
Last active March 14, 2021 20:45 — forked from mistic100/Mediakeys.ahk
Media keys shortcuts for AutoHotkey
; AutoHotkey Media Keys
^!Space::Send {Media_Play_Pause}
^!Left::Send {Media_Prev}
^!Right::Send {Media_Next}
^!#::Send {Volume_Mute}
^!Up::Send {Volume_Up}
^!Down::Send {Volume_Down}
@CreamyCookie
CreamyCookie / auto_update_tags_in_files.py
Last active September 23, 2020 17:39
QuodLibet Plugin that automatically stores ratings and playcounts in the respective files
# Copyright 2016 Joschua Gandert
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
from traceback import format_exc
@CherryDT
CherryDT / evernote_code_wrap.ahk
Last active August 6, 2020 13:09
Evernote clipboard code wrapper tool
; AutoHotkey script to wrap plain text clipboard contents for Evernote in such a way that they can be pasted as code
; block and won't get double empty lines, removed indents or anything like that.
; By David Trapp
; License: MIT
; WinClip is required, from here: https://autohotkey.com/board/topic/74670-class-winclip-direct-clipboard-manipulations/
#include %A_ScriptDir%\WinClipAPI.ahk
#include %A_ScriptDir%\WinClip.ahk
@heardk
heardk / OneNote-to-MD.md
Last active June 24, 2024 07:16
Convert notes from OneNote into Markdown

Converting One Note to Markdown

This is an example of how to convert notes from OneNote into Markdown to use in other, less annoying Note applications. I am using PowerShell on Windows here, but other shell/scripting environments would work as well. If you want separate .md files, you'll need to export your OneNote pages separately. Exporting a section, or a selection of pages creates a single .docx file.

  • Download and install Pandoc
  • Export each of your note pages to a .docx (Word) format using OneNote export from the File menu
  • Gather all of these .docx files into a directory
  • Open directory in File Explorer
  • Open Powershell from the File Explorer using File -> Open Windows Powersell
  • Run the following command:
@RichardBronosky
RichardBronosky / touchid_sudo.sh
Last active June 21, 2024 12:00
Use TouchID for sudo on modern MacBook Pro machines
#!/bin/bash
# curl -sL https://gist.githubusercontent.com/RichardBronosky/31660eb4b0f0ba5e673b9bc3c9148a70/raw/touchid_sudo.sh | bash
# This script is ready to copy-paste in whole, or just the line above (without the leading #)
# Use TouchID for sudo on modern MacBook Pro machines
# This script adds a single line to the top of the PAM configuration for sudo
# See: https://apple.stackexchange.com/q/259093/41827 for more info.
touchid_sudo(){
@prasanthj
prasanthj / lirc-pi3.txt
Last active June 20, 2024 10:09
Getting lirc to work with Raspberry Pi 3 (Raspbian Stretch)
Notes to make IR shield (made by LinkSprite) work in Raspberry Pi 3 (bought from Amazon [1]).
The vendor has some documentation [2] but that is not complete and sufficient for Raspbian Stretch.
Following are the changes that I made to make it work.
$ sudo apt-get update
$ sudo apt-get install lirc
# Add the following lines to /etc/modules file
lirc_dev
lirc_rpi gpio_in_pin=18 gpio_out_pin=17
@gilhooleyd
gilhooleyd / spotify.py
Created August 8, 2017 00:48
Siri Control + Spotify
import sys
import os
import subprocess
import spotipy
import spotipy.util as util
import json
#This is name of the module - it can be anything you want
moduleName = "spotify"
#!/usr/bin/env python
# -*- coding: utf8 -*-
# MFRC522_test.py - Copyright 2017-2019, Phil Elwell, Raspberry Pi (Trading) Ltd.
import RPi.GPIO as GPIO
import spi
import signal
import time
@edmondscommerce
edmondscommerce / BASH_function_to_email_via_Gmail_SMTP.bash
Last active August 21, 2018 07:58
BASH function to email via Gmail SMTP
# Bash function to send email via Gmail SMTP
# sendEmail [subject] [toEmail] [message] (optional attachment path)
function sendEmail(){
if (($# < 3 ))
then
echo ""
echo "Usage:"
echo "sendEmail [subject] [toEmail] [message] (optional attachment path)"
echo ""
exit 1