Skip to content

Instantly share code, notes, and snippets.

@akkidas
akkidas / HowToOTGFast.md
Created September 8, 2016 02:01 — forked from gbaman/HowToOTGFast.md
Simple guide for setting up OTG modes on the Raspberry Pi Zero, the fast way!

###Setting up Pi Zero OTG - The quick way (No USB keyboard, mouse, HDMI monitor needed)
More details - http://blog.gbaman.info/?p=791

For this method, alongside your Pi Zero, MicroUSB cable and MicroSD card, only an additional computer is required, which can be running Windows (with Bonjour, iTunes or Quicktime installed), Mac OS or Linux (with Avahi Daemon installed, for example Ubuntu has it built in).
1. Flash Raspbian Jessie full or Raspbian Jessie Lite onto the SD card.
2. Once Raspbian is flashed, open up the boot partition (in Windows Explorer, Finder etc) and add to the bottom of the config.txt file dtoverlay=dwc2 on a new line, then save the file.
3. Finally, open up the cmdline.txt. Be careful with this file, it is very picky with its formatting! Each parameter is seperated by a single

@akkidas
akkidas / guid-sql-server.sql
Created April 13, 2016 17:59
Generate New Guid (uniqueidentifier) in SQL Server
-- If you want to generate a new Guid (uniqueidentifier) in SQL server the you can simply use the NEWID() function.
SELECT NEWID()
GO
-- This will return a new random uniqueidentifier e.g.
E75B92A3-3299-4407-A913-C5CA196B3CAB
To select this Guid in in a variable
--assign uniqueidentifier in a variable
DECLARE @EmployeeID uniqueidentifier
// Setup the LDAP client (normally done via Spring context file).
LdapContextSource contextSource = new LdapContextSource();
contextSource.setUrl("ldap://localhost:389");
contextSource.setBase("DC=COMPANY,DC=COM");
contextSource.setUserDn("user@test.com");
contextSource.setPassword("password");
contextSource.afterPropertiesSet();
LdapTemplate ldapTemplate = new LdapTemplate(contextSource);
ldapTemplate.afterPropertiesSet();
@akkidas
akkidas / gist:516be47ce8591a15e7f9
Created March 27, 2016 02:12
Uninstall JRE from Mac OSX
Remove one directory and one file (a symlink)
1. Navigate to /Library/Internet Plug-Ins and remove the JavaAppletPlugin.plugin directory.
2. Navigate to /Library/PreferencePanes and remove JavaControlPanel.prefpane.
Do not attempt to uninstall Java by removing the Java tools from /usr/bin.
This directory is part of the system software and any changes will be reset by Apple the next time you perform an update of the OS.
sudo rm -rf /Library/Internet\ Plug-Ins/JavaAppletPlugin.plugin/
sudo rm -rf /Library/PreferencePanes/JavaControlPanel.prefPane
@akkidas
akkidas / openjdk9.sh
Created March 27, 2016 02:10
Mac OS X El Capitan OpenJDK 9
# Mac OSX:10.11.3
# Xcode:7.2.1
# XQuartz
hg clone http://hg.openjdk.java.net/jdk9/jdk9 jdk9
cd jdk9
chmod u+x get_source.sh
./get_source.sh
chmod u+x configure
./configure --with-freetype-include=/opt/X11/include/freetype2 --with-freetype-lib=/opt/X11/lib --disable-warnings-as-errors