Skip to content

Instantly share code, notes, and snippets.

View azizshamim's full-sized avatar
:octocat:
talkin' bout GitHub

Aziz Shamim azizshamim

:octocat:
talkin' bout GitHub
View GitHub Profile
@azizshamim
azizshamim / gist:2011ea19ae3c4ffcb612
Last active August 29, 2015 14:05
my_git_aliases
# Type these commands in order to add the aliases
git config --global alias.lol 'log --pretty=oneline --abbrev-commit --graph --decorate'
git config --global alias.ll 'log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative'
git config --global alias.lola 'log --graph --pretty=format:"%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset" --abbrev-commit --date=relative --all'
git config --global alias.s 'status -su'
@azizshamim
azizshamim / report_error.js
Created December 30, 2014 21:51
javascript done with errors
exports.report_error = function(err, res, done) {
if (err) {
return done(err);
} else {
done();
}
}
@azizshamim
azizshamim / install.sh
Last active August 29, 2015 14:18
Installing elixir on a Raspberry Pi 2
#!/bin/bash
# Install the prerequisites as root
sudo apt-get install erlang-mini erlang-eunit
# Clone elixir
git clone https://github.com/elixir-lang/elixir.git
cd elixir
# cat snmpd.conf
rouser sysadmin priv
createUser sysadmin MD5 "mypassword1" AES "mypassphrase1"
# snmpwalk -v3 -u sysadmin -l authPriv -a md5 -A mypassword1 -x aes -X mypassphrase1 localhost system.sysDescr.0
snmpwalk: Unsupported security level (Sub-id not found: (top) -> system)
#!/usr/bin/php -q
<?php
# IN PHP
preg_match("/welcome!?/", "welcome is the new welcome!", $matches);
print "In PHP, the regex matches: ".$matches[0]."\n";
?>
$ In PHP, the regex matches: welcome
#!/usr/bin/perl -w
# IN PERL
use strict;
my $string = "welcome is the new welcome!";
$string =~ m/welcome!?/;
print 'In perl, the index of the match is: '.length($`)."\n";
$ In perl, the index of the match is: 0
#!/usr/bin/env ruby
# RUBY
string = "welcome is the new welcome!"
regex = Regexp.new(/welcome!?/)
puts "In ruby the index of the match is: "+string.index(regex).to_s
$ In ruby the index of the match is: 0
@azizshamim
azizshamim / freenode_ssl_Ca
Created November 3, 2010 20:34
The CA Cert for Freenode
-----BEGIN CERTIFICATE-----
MIIEozCCA4ugAwIBAgIQWrYdrB5NogYUx1U9Pamy3DANBgkqhkiG9w0BAQUFADCB
lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug
Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho
dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt
SGFyZHdhcmUwHhcNMDgxMDIzMDAwMDAwWhcNMjAwNTMwMTA0ODM4WjBBMQswCQYD
VQQGEwJGUjESMBAGA1UEChMJR0FOREkgU0FTMR4wHAYDVQQDExVHYW5kaSBTdGFu
ZGFyZCBTU0wgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC2VD2l
2w0ieFBqWiOJP5eh1AcaqVgIm6AVwzK2t/HouaVvrTf2bnEbtHUtSF6fxhWqge/l
xIiVijpsd8y1zWXkZ+VzyVBSlMEnST6ga0EWQbaUmUGuPsviBkYJ6U2+yUxVqRh+
@azizshamim
azizshamim / ruby-enterprise.spec
Created November 1, 2011 19:45 — forked from axisofentropy/ruby-enterprise.spec
patched the source for ppc (don't use for other architectures)
# Package Maintainer: Increment phusion_release to match latest release available
%define phusion_release 2011.03
%define _prefix /opt/ree
Summary: Ruby Enterprise Edition (Release %{phusion_release})
Name: ruby-enterprise
Vendor: Phusion.nl <info@phusion.nl>
Packager: Adam Vollrath <hosting@endpoint.com>
Version: 1.8.7
Release: 8%{dist}
License: Ruby or GPL v2
@azizshamim
azizshamim / ree-ppc.patch
Created November 1, 2011 19:55
Patch for ree to help compile on ppc
--- ruby-enterprise-1.8.7-2011.03/source/Makefile.in 2011-02-24 04:09:12.000000000 -0600
+++ ruby-enterprise-1.8.7-2011.03/source/Makefile.in 2011-11-01 14:38:45.000000000 -0500
@@ -178,7 +178,7 @@
rm -f y.tab.c
.c.@OBJEXT@:
- $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+ $(CC) $(CFLAGS) $(CPPFLAGS) -Xassembler -mregnames -c $<
.s.@OBJEXT@: