Skip to content

Instantly share code, notes, and snippets.

View sighmon's full-sized avatar

Simon Loffler sighmon

View GitHub Profile
@giannisp
giannisp / gist:ebaca117ac9e44231421f04e7796d5ca
Last active March 1, 2024 14:39
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
@jpierson
jpierson / switch-local-git-repo-to-fork.md
Last active December 26, 2022 21:48 — forked from jagregory/gist:710671
How to move to a fork after cloning

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step)

    git clone git@github...some-repo.git

A Beginner's Guide to Media Whistleblowing

You're a tech novice, leaking to a reporter for the first time. Computers are confusing. Encryption is a very long and very tiring word. The people who know how to do this all talk like holier-than-thou jackasses. (Spoiler: we pretty much are.) Here's a quick, hopefully beginner-friendly guide to safer leaking.

  1. Don't use your phone. There are some marginally safe ways to use phones, but you're not going to manage them. Just put it down, and never try to do anything terrible or heroic with a cell phone. The same is true of email.

  2. Don't do anything from your work, your house or your regular haunts. There's various ways of tracing things back, and you don't want to have to worry about them.

  3. Use someone else's WiFi. A cafe or a library, or better yet, the laundromat or cafe next to the one with the WiFi you're using. This takes a little investigation, but it's not hard. Get a few passwords as a customer and think about where you can sit unobtrusi

@gomfunkel
gomfunkel / elgato-eve.md
Last active September 9, 2023 18:28
Elgato Eve HomeKit Services & Characteristics

Elgato Eve HomeKit Services & Characteristics

A work in progress collection of proprietary and as of yet undocumented HomeKit characteristics and their UUIDs used by Elgato Eve.

This list is not including all Eve accessories available and some services and characteristics still make no sense to me. If you have anything to contribute, please leave a comment. There is no guarantee that the information listed below is correct.

Elgato Eve Energy (Firmware Revision 1.3.1;466)

Service - Characteristic UUID R W Type Description
@ivanyv
ivanyv / application.amp.erb
Created December 12, 2015 02:51
Easy Google AMP on Rails
<html>
<head>
<link rel="canonical" href="<%= current_uri_sans_amp %>">
</head>
...
</html>
@colinmahns
colinmahns / otrdm.md
Last active March 31, 2021 19:33
HOWTO: Twitter DM with OTR

Twitter DM + OTR: A quick and dirty tutorial

With the recent removal of the 140-character limit in Direct Messages by Twitter, DM's have now become a much more useful platform for communicating between individuals and groups. Sadly, DM's are still sent in plaintext between users and Twitter has no plans currently on encrypting these messages, at least as of August 2015. Since these are stored in plaintext at rest, an adversary can see the content of the message you are sending, which the two parties might not wish to happen. Fortunately as a few applications with basic Twitter support which also have excellent support for OTR, all hope isn't lo

Simple Security Guidelines

Using an iDevice? (Best option)

  • Use an iPod or an iPad without a SIM card
  • Use an iPhone
  • Do not jailbreak
  • Always upgrade to new iOS versions
  • Use Brave browser

Need Secure chat?

# This class shows uses version 0.28.7 of the ruby google-api-client gem circa April 2019
# to query the Google Play subscription API.
#
# If using an older version of the google-api-client gem (ie. version 0.8.x), instead refer to:
# https://gist.github.com/jkotchoff/e60fdf048ec443272045/e3e2c867633900d9d6f53de2de13aa0a0a16bb03
#
# Sample usage:
#
# package_name = 'com.stocklight.stocklightapp'
# product_id = 'com.stocklight.stocklight.standardsubscription'
01. Connect to the VPN (so OSX generates the racoon configuration file)
02. Copy the generated configuration file to /etc/racoon:
$ sudo cp /var/run/racoon/1.1.1.1.conf /etc/racoon
03. Edit the racoon configuration file with your favorite editor (vim):
$ sudo vim /etc/racoon/racoon.conf
04. At the bottom of the file comment out the line:
# include "/var/run/racoon/*.conf" ;
#pragma mark -
#pragma mark CGFloat
#pragma mark Trigonometric Functions
#define CGFloatCos(a) (CGFLOAT_IS_DOUBLE ? cos(a) : cosf(a))
#define CGFloatSin(a) (CGFLOAT_IS_DOUBLE ? sin(a) : sinf(a))
#define CGFloatTan(a) (CGFLOAT_IS_DOUBLE ? tan(a) : tanf(a))
#define CGFloatACos(a) (CGFLOAT_IS_DOUBLE ? acos(a) : acosf(a))
#define CGFloatASin(a) (CGFLOAT_IS_DOUBLE ? asin(a) : asinf(a))
#define CGFloatATan(a) (CGFLOAT_IS_DOUBLE ? atan(a) : atanf(a))