Skip to content

Instantly share code, notes, and snippets.

@nandub
nandub / gist:222969
Created October 31, 2009 07:27
git add commit push
#!/bin/bash
export MESSAGE=$1
export BRANCH=$2
if [ "$MESSAGE" == "" ]
then
echo "Usage $0 commit-message"
exit 1
fi
export MESSAGE="${MESSAGE}"
@nandub
nandub / git-pull-all.bash
Created September 4, 2010 02:24
Simple bash script to update all git-clone repos from a local directory
#!/bin/bash
f=$(pwd) # 'pwd' is "present working directory"
FOLDERS=`ls -d $f/*`
for f in $FOLDERS
do
if [ -d "$f/.git" ]; then
pushd $f
git pull
@nandub
nandub / values.c
Created September 24, 2010 20:24
Solaris x86 specific GCC run-time environment patch
#if 0
#
# This is Solaris x86 specific GCC run-time environment patch, which
# makes it possible to reliably deploy .init snippets. Trouble is that
# Solaris linker erroneously pads .init segment with zeros [instead of
# nops], which is bound to SEGV early upon program start-up. This bug
# was recognized by GCC team [it is mentioned in source code], but
# workaround apparently and obviously erroneously slipped away in some
# newer GCC release. This patch compensates for this mishap by dropping
# modified values-X*.o into GCC installation tree. Object modules in
@nandub
nandub / ProtobufEnvelope.java
Created May 1, 2011 05:52
ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
import com.google.protobuf.DescriptorProtos;
import com.google.protobuf.Descriptors;
import com.google.protobuf.DynamicMessage;
import com.google.protobuf.Message;
import java.util.HashMap;
/**
* ProtobufEnvelope - allows creating a protobuf message without the .proto file dynamically.
*
@nandub
nandub / ath5-2.6.38-8-natty-fix
Created August 25, 2011 23:46
Kernel 2.6.38.8: ath5k driver wireless signalstrength critically weak - Natty workaround fix
#!/bin/bash
#Got this solution from http://fossplanet.com/f10/%5Bbug-775104%5D-%5Bnew%5D-kernel-2-6-38-8-ath5k-driver-wireless-signalstrength-critically-weak-148704/ by salemboot
apt-get install subversion
cd /usr/src
svn checkout http://madwifi-project.org/svn/madwifi/trunk madwifi
tar cfvz madwifi.tgz
cd madwifi
make && make install
@nandub
nandub / gist:1381650
Created November 21, 2011 04:44
git fix merge conflicts steps
cd <PROJECT>
git remote add upstream git@github.com:<GITHUB_ACCOUNT_NAME>/<PROJECT>.git
git fetch upstream
#Stash/commit all your work
git checkout develop
git merge upstream/develop
git checkout <FEATURE_BRANCH>
git merge develop
#Fix errors, merge conflicts, etc.
#Run tests
@nandub
nandub / crosstool-ng-1.16.0_clang_offsetof_fix.patch
Created February 27, 2012 11:29
crosstool-ng 1.16.0 - Fixes clang offsetof compatability.
diff --git a/Makefile.in b/Makefile.in
index 3772058..74a2d79 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -348,7 +348,7 @@ KCONFIG_FILES := conf mconf nconf kconfig.mk
install-lib-kconfig: $(DESTDIR)$(libdir) install-lib-main
@echo " INST 'kconfig/'"
@for f in $(KCONFIG_FILES); do \
- install -D "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
+ $(install) -D "kconfig/$${f}" "$(DESTDIR)$(libdir)/kconfig/$${f}"; \
@nandub
nandub / gperf_3.0.3_generated_zconf.hash.c
Created March 18, 2012 23:32
Invalid gperf 3.0.3 zconf.hash.c file
/* ANSI-C code produced by gperf version 3.0.3 */
/* Command-line: gperf ../crosstool-ng-1.14.1/kconfig/zconf.gperf */
/* Computed positions: -k'1,3' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
@nandub
nandub / gperf_3.0.4_generated_zconf.hash.c
Created March 18, 2012 23:36
Valid gperf 3.0.4 zconf.hash.c file
/* ANSI-C code produced by gperf version 3.0.4 */
/* Command-line: src/gperf ../crosstool-ng-1.14.1/kconfig/zconf.gperf */
/* Computed positions: -k'1,3' */
#if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
&& ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
&& (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
&& ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
&& ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
&& ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
@nandub
nandub / io-formula-head-fail
Created March 29, 2012 06:53
Io install failed for HEAD
$ brew install -v io --HEAD
==> Installing io
==> Cloning https://github.com/stevedekorte/io.git
git clone --depth 1 https://github.com/stevedekorte/io.git /Library/Caches/Homebrew/io--git
Cloning into '/Library/Caches/Homebrew/io--git'...
remote: Counting objects: 6135, done.
remote: Compressing objects: 100% (4184/4184), done.
remote: Total 6135 (delta 2045), reused 4540 (delta 1297)
Receiving objects: 100% (6135/6135), 15.02 MiB | 184 KiB/s, done.
Resolving deltas: 100% (2045/2045), done.