Skip to content

Instantly share code, notes, and snippets.

View jeff-dagenais's full-sized avatar

Jean-François Dagenais jeff-dagenais

View GitHub Profile
function FindProxyForURL(url, host) {
return "SOCKS5 localhost:1080";
}
function FindProxyForURL(url, host) {
return "SOCKS5 localhost:1080";
}
#!/usr/bin/ruby
# Create display override file to force Mac OS X to use RGB mode for Display
# see http://embdev.net/topic/284710
require 'base64'
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay`
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten
@jeff-dagenais
jeff-dagenais / modify_basesystem_dmg.py
Created August 2, 2018 23:54 — forked from bruienne/modify_basesystem_dmg.py
Modify BaseSystem.dmg inside an InstallESD.dmg
#!/usr/bin/python
# modify_basesystem_dmg.py
#
# Adds additional frameworks to BaseSystem.dmg - Python is default
# Modify cpioextract() and xar_source to change what is extracted,
# and from what OS X installer PKG.
#
# To invoke:
#
# ./modify_basesystem_dmg.py /path/to/InstallESD.dmg
@jeff-dagenais
jeff-dagenais / ethminer_ubuntu_nvidia.md
Last active March 2, 2018 02:29 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@jeff-dagenais
jeff-dagenais / gist:d63a3c5db8f38d59b133fe158453c358
Created March 23, 2017 14:50
u-boot-xlnx xilinx-v2016.4 with 2016.7 zcu102 1.0 psu_init
<debug_uart> Debug uart enabled
U-Boot SPL 2016.07 (Mar 23 2017 - 10:31:34)
EL Level: EL3
Invalid Boot Mode:0xe
Trying to boot from RAM
"Synchronous Abort" handler, esr 0x02000000
ELR: 8000000
LR: fffc5adc
x0 : 0000000008000000 x1 : 0000000000000000
#!/bin/bash
#
# Enable TRIM support for 3rd Party SSDs. Works for Mountain Lion, should work on earlier OSes too.
# Tested on 10.8.2, 10.8.3, 10.8.5, 10.9.0-10.9.5, 10.10.0-10.10.1
#
# Run this script at your own risk, whether on 10.10 or earlier.
#
# This script works on MacOS 10.10 (Yosemite) but it has significant system security repercussions.
# To use it you must disable kext signing on your machine. This makes it easier for
# malware to infect your machine by disabling the feature which would detect unsigned

Enable TRIM on non-Apple SSDs in OS X

NOTE: This is tested on the versions mentioned in the title, and NOT earlier or later versions. YMMV.

Run the following commands in Terminal…

Backup the original driver:

sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage-backup

pool management

  • create a new pool by first creating an empty partition space using diskutil or Disk Utility

adding a mirror to an existing pool

check current status

zpool status -v
#!/bin/bash
#
# This script backups an OS X system to an external volume, effectively
# cloning it. It is based on [0], [1] and [2] for OS X and [3] and [4] for
# Linux. One could also use commercial tools like SuperDuper! or Carbon Copy
# Cloner. The latter website has an interesting list[5] on what files to
# exclude when cloning.
#
# Exclusions (from CCC[5]), see rsync_excludes_osx.txt
#