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 /
Created Jan 27, 2019 — forked from colinstein/
Storing CLI password in Keychain on Mac OS X

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 /
Created Jul 16, 2018 — forked from dreikanter/
File encryption using OpenSSL

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 / 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 /
Created Jun 6, 2018 — forked from solepixel/
Use wget to batch download a list of image URLs
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 /
Created Feb 20, 2018 — forked from acrookston/
Xcode pre-action to build custom Info.plist

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 into the pre-action script box.

romainbriche /
Created Feb 20, 2018 — forked from rreusser/
A kinda hacky script to set up iOS env config for RN, Objective-C, and preprocessor defines.
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 /
Created Jan 7, 2018 — forked from chrismdp/
Uploading to S3 in 18 lines of Shell (used to upload builds for
# 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 (
# Based on a modified script from here:
S3KEY="my aws key"
S3SECRET="my aws secret" # pass these in
function putS3
romainbriche /
Created Jan 7, 2018 — forked from jpillora/
S3 signed GET in plain bash (Requires openssl and curl)
#set these in your environment/profile (NOT HERE)
function s3get {
#helper functions
function fail { echo "$1" > /dev/stderr; exit 1; }
#dependency check
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
rem the dir on the device where the screenshot will be stored temporarily
rem adb path, leave blank if adb is already on the user or system path
You can’t perform that action at this time.