Skip to content

Instantly share code, notes, and snippets.

Romain Briche romainbriche

Block or report user

Report or block romainbriche

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@romainbriche
romainbriche / keychaincli.md
Created Jan 27, 2019 — forked from colinstein/keychaincli.md
Storing CLI password in Keychain on Mac OS X
View keychaincli.md

Secure CLI Passwords with Keychain Services on Mac OS X

Creating a Password

Dump a password into keychain. I'm using the creator/kind codes "asbl" for Ansible, but you can use any 4 character code. It's useful for doing lookups later.

$ security add-generic-password -a "root" -c "asbl" -C "asbl" -D "Ansible Vault" -s "ansible secrets" -w "secret123password456"

From man security:

@romainbriche
romainbriche / encrypt_openssl.md
Created Jul 16, 2018 — forked from dreikanter/encrypt_openssl.md
File encryption using OpenSSL
View encrypt_openssl.md

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@romainbriche
romainbriche / StreamReader.swift
Created Jun 8, 2018 — forked from sooop/StreamReader.swift
Read a large text file line by line - Swift 3
View StreamReader.swift
import Foundation
class StreamReader {
let encoding: String.Encoding
let chunkSize: Int
let fileHandle: FileHandle
var buffer: Data
let delimPattern : Data
var isAtEOF: Bool = false
@romainbriche
romainbriche / batch-download-images.sh
Created Jun 6, 2018 — forked from solepixel/batch-download-images.sh
Use wget to batch download a list of image URLs
View batch-download-images.sh
wget -i image-list.txt --force-directories
View CIFilter+Extension.swift
//
// Created by はるふ on 2017/12/11.
// Copyright © 2017年 ha1f. All rights reserved.
//
import Foundation
import CoreImage
import AVFoundation
extension CIFilter {
@romainbriche
romainbriche / README.md
Created Feb 20, 2018 — forked from acrookston/README.md
Xcode pre-action to build custom Info.plist
View README.md

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@romainbriche
romainbriche / build-environment.py
Created Feb 20, 2018 — forked from rreusser/build-environment.py
A kinda hacky script to set up iOS env config for RN, Objective-C, and preprocessor defines.
View build-environment.py
#!/usr/bin/python
from plistlib import readPlist as read_plist
from subprocess import check_output
import socket
import json
from datetime import datetime
import os
# Export your version of these for testing the script from the console directly:
@romainbriche
romainbriche / s3.sh
Created Jan 7, 2018 — forked from chrismdp/s3.sh
Uploading to S3 in 18 lines of Shell (used to upload builds for http://soltrader.net)
View s3.sh
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine
# This is how I upload my new Sol Trader builds (http://soltrader.net)
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
{
path=$1
@romainbriche
romainbriche / s3get.sh
Created Jan 7, 2018 — forked from jpillora/s3get.sh
S3 signed GET in plain bash (Requires openssl and curl)
View s3get.sh
#!/bin/bash
#set these in your environment/profile (NOT HERE)
AWS_ACCESS_KEY=""
AWS_SECRET_KEY=""
function s3get {
#helper functions
function fail { echo "$1" > /dev/stderr; exit 1; }
#dependency check
@romainbriche
romainbriche / Android Screenshot.bat
Created Dec 18, 2017 — forked from leighmcculloch/Android Screenshot.bat
This batch script will take a screenshot on an Android device using ADB, download the screenshot to the directory this script to the current directory and then remove the screenshot file from the device. Screenshots are saved with filename: screenshot-YYYYMMDD-HHMMSS.png. ADB must be connected to a device already.
View Android Screenshot.bat
@echo off
rem configurable parameters
set SCREENCAP_FILE_PREFIX=screenshot
rem the dir on the device where the screenshot will be stored temporarily
set SCREENCAP_WORKING_DIR=/sdcard/
rem adb path, leave blank if adb is already on the user or system path
set SCREENCAP_ADB_PATH=
You can’t perform that action at this time.