Skip to content

Instantly share code, notes, and snippets.

View timotgl's full-sized avatar

Timo Taglieber timotgl

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
@dleonard00
dleonard00 / explode-opvn.sh
Created January 15, 2017 07:31
extract the certificate and key from an .ovpn file
#!/bin/bash
# This script will extract the certificate and key from an .ovpn file
# into their own files, which makes it possible to use them to configure
# the VPN using Ubuntu's network manager
# Usage example:
# >> ovpnconvert username.dev.ovpn
# You can keep following these instructions here:
@michaelrambeau
michaelrambeau / webpack-devserver.js
Created February 27, 2016 13:33
Script to launch webpack dev server (instead of using `webpack-dev-server --content-base www --hot` command).
// node.js server used to serve assets bundled by Webpack
// use `npm start` command to launch the server.
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('../../config/webpack.local.config');
console.log('Starting the dev web server...');
const port = 8080;
const path = require('path');
const options = {
$ openssl req -x509 -nodes -newkey rsa:1024 -keyout keyfile.key -out certificate.cer
$ echo "hello!" > data.txt
$ openssl smime -sign -md sha1 \
> -binary -nocerts -noattr \
> -in data.txt -out data.txt.signed -outform der \
> -inkey keyfile.key \
> -signer certificate.cer
$ openssl asn1parse -inform der -in data.txt.signed
$ hexdump -C data.txt
@subfuzion
subfuzion / global-gitignore.md
Last active May 5, 2024 19:34
Global gitignore

There are certain files created by particular editors, IDEs, operating systems, etc., that do not belong in a repository. But adding system-specific files to the repo's .gitignore is considered a poor practice. This file should only exclude files and directories that are a part of the package that should not be versioned (such as the node_modules directory) as well as files that are generated (and regenerated) as artifacts of a build process.

All other files should be in your own global gitignore file:

  • Create a file called .gitignore in your home directory and add any filepath patterns you want to ignore.
  • Tell git where your global gitignore file is.

Note: The specific name and path you choose aren't important as long as you configure git to find it, as shown below. You could substitute .config/git/ignore for .gitignore in your home directory, if you prefer.

@borella
borella / gist:11285316
Created April 25, 2014 10:48
Google Chrome with local file access on Mac OS X
open /Applications/Google\ Chrome.app --args --allow-file-access-from-files
@urschrei
urschrei / parseml.py
Last active March 25, 2024 02:20
Extract attachments from EML files in the current dir, and write them to the output subdir
#!/usr/bin/env python
"""
2020 update:
- More iterators, fewer lists
- Python 3 compatible
- Processes files in parallel
(one thread per CPU, but that's not really how it works)
"""