To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
- Homebrew
- Mountain Lion -> High Sierra
To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time.
sudo apt-get install build-essential libsqlite3-dev zlib1g-dev libncurses5-dev libgdbm-dev libbz2-dev libreadline5-dev libssl-dev libdb-dev | |
wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz | |
tar -xzf Python-2.7.3.tgz | |
cd Python-2.7.3 | |
./configure --prefix=/usr --enable-shared | |
make | |
sudo make install | |
cd .. |
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 |
#!/bin/sh | |
# This program has two feature. | |
# | |
# 1. Create a disk image on RAM. | |
# 2. Mount that disk image. | |
# | |
# Usage: | |
# $0 <dir> <size> | |
# |
import base64 | |
import struct | |
import datetime | |
import binascii | |
from urllib.parse import quote_plus | |
# pip install pycryptodomex | |
from Cryptodome import Random | |
from Cryptodome.Cipher import AES |
import Foundation | |
import UIKit | |
extension UIColor { | |
convenience init(hexString:String) { | |
let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) | |
let scanner = NSScanner(string: hexString) | |
if (hexString.hasPrefix("#")) { | |
scanner.scanLocation = 1 |
#!/usr/bin/env python | |
# | |
# Copyright 2012 Patrick Hetu <patrick.hetu@gmail.com> | |
# | |
# 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 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
#!/usr/bin/env python | |
""" | |
A script to query the Amazon Web Services usage reports programmatically. | |
Ideally this wouldn't exist, and Amazon would provide an API we can use | |
instead, but hey - that's life. | |
Basically takes your AWS account username and password, logs into the | |
website as you, and grabs the data out. Always gets the 'All Usage Types' |
import requests | |
import time | |
import json | |
arr = [] | |
end_cursor = '' # empty for the 1st page | |
tag = 'russia' # your tag | |
page_count = 5 # desired number of pages | |
for i in range(0, page_count): | |
url = "https://www.instagram.com/explore/tags/{0}/?__a=1&max_id={1}".format(tag, end_cursor) | |
r = requests.get(url) |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
"""Kenneth Reitz's GitHub Syncer | |
This script uses the GitHub API to get a list of all forked, mirrored, public, and | |
private repos in your GitHub account. If the repo already exists locally, it will | |
update it via git-pull. Otherwise, it will properly clone the repo. | |
It will organize your repos into the following directory structure: |