Skip to content

Instantly share code, notes, and snippets.

@kamituel
kamituel / gist:4537473
Last active December 11, 2015 03:28
Generating CSR on Linux
$ openssl genrsa -des3 -out domainname.key 2048 # protect key with passphrase
$ openssl genrsa -out domainname.key 2048 # do not use passphrase
$ openssl req -sha1 -new -key domainname.key -out domainname.csr
# ... truncated
Country Name (2 letter code) [XX]:PL
State or Province Name (full name) []:Mazowieckie
Locality Name (eg, city) [Default City]:Warsaw
Organization Name (eg, company) [Default Company Ltd]:
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:my.domain.com
@kamituel
kamituel / gist:4539409
Last active December 11, 2015 03:38
Android: basic usage of NFC
NfcAdapter nfcAdapter = NfcAdapter.getDefaultAdapter(getApplicationContext());
if ( nfcAdapter == null ) {
// Alert user that his device is incompatible
// or deal with it in different way
Log.w("nfc-test", "No NFC adapter present");
} else {
if ( nfcAdapter.isEnabled() ) {
// Everything ok: NFC present and enabled.
Log.d("nfc-test", "NFC enabled");
@kamituel
kamituel / gist:4539737
Created January 15, 2013 16:09
Android: when put into Manifest.xml, it makes app invisible in Google Play to devices with no NFC support.
<uses-feature android:name="android.hardware.nfc" android:required="true" />
@kamituel
kamituel / gist:4541785
Created January 15, 2013 20:34
Using "xargs echo -n"
#!/bin/bash
USERS=($(ps axu | cut -f 1 -d \ | tail -n +2 | sort | uniq | xargs echo -n))
echo ${#USERS[@]} users: ${USERS[@]}
$ yum install expat expat-devel openssl openssl-devel
$ yum remove git git-all
@kamituel
kamituel / gist:4542056
Created January 15, 2013 21:04
Building Git with expat and openssl support.
$ wget http://git-core.googlecode.com/files/git-1.8.1.tar.gz
$ tar zxf git-1.8.1.tar.gz
$ cd git-1.8.1
$ ./configure --with-expat --with-openssl
@kamituel
kamituel / gist:4542064
Created January 15, 2013 21:05
Installing Git with openssl and expat support.
checking for curl_global_init in -lcurl... yes
checking for XML_ParserCreate in -lexpat... yes
$ make
$ make install
@kamituel
kamituel / gist:4564266
Last active December 11, 2015 07:09
Installing Buildbot on Ubuntu 12.04
$ apt-get install python-setuptools
$ wget http://buildbot.googlecode.com/files/buildbot-0.8.7p1.tar.gz
$ wget http://buildbot.googlecode.com/files/buildbot-slave-0.8.7p1.tar.gz
$ tar zxf buildbot-0.8.7p1.tar.gz
$ tar zxf buildbot-slave-0.8.7p1.tar.gz
$ easy_install buildbot-0.8.7p1
$ easy_install buildbot-slave-0.8.7p1
@kamituel
kamituel / gist:4564281
Last active December 11, 2015 07:08
Buildbot: create master and slave with default configuration options.
# Syntax: buildbot create-master DIR/
$ buildbot create-master master/
$ cp master/master.cfg.sample master/master.cfg
# Syntax: buildslave create-slave DIR MASTER_CONN NAME PASS
$ buildslave create-slave slave/ localhost:9989 example-slave pass