Skip to content

Instantly share code, notes, and snippets.

yum "Couldn't resolve host 'mirrorlist.centos.org'" for CentOS 6.4
solution from http://chris.m0nk3y.net/blog
========
The likely cause of your problem was that the local dns server (bind if you're using virtualmin) isn't allowing recursive lookups, which it should do from localnets.
/etc/named.conf, mine contains
================
@dhaneshkk
dhaneshkk / GVim Escape from Escape key
Last active December 22, 2015 19:39
Reaching out for escape key is a major hurdle, while working with vim, So i have remapped my Caps key. for single click it will act as escape key but if caps key pressed with any other key combination it will act as control key.
; Author: dhaneshkk at gmail com
#IfWinActive ahk_class Vim ; "Vim" is Gvim's window name.
#InstallKeybdHook
Capslock::
Send {LControl Down}
KeyWait, CapsLock
Send {LControl Up}
if ( A_PriorKey = "CapsLock" )
{
@dhaneshkk
dhaneshkk / dictionary show
Created September 22, 2013 10:06
Processing script for displaying content of file(personal dictionary file) in Powerpoint slide show format.
float alpha = 255;
float rate = 1;
int counter = 0;
int line = 0;
int direction = -1;
//dictionary file to string array.
String[] PersonaldictionaryLines = loadStrings("file.txt");
void setup() {
size(1500, 300);
@dhaneshkk
dhaneshkk / goplayground.bat
Created February 15, 2014 09:28
batch file, to set-up Go-Playground on windows
REM modified version of brainman's batch file at https://groups.google.com/forum/#!topic/golang-nuts/QVPKm7pbhds
REM setting goroot to my go installation folder.
set GOROOT=C:\go
REM setting gopath to my go playground folder
set GOPATH=C:\Users\****\goplayground
Set GOBIN=%GOPATH%\bin
set PATH=%PATH%;c:\go\bin;%GOBIN%
@dhaneshkk
dhaneshkk / erlangbuild
Last active August 29, 2015 13:56
Erlang 16B03-1 Compile and build for CentOS 6.4 x64
sudo yum upgrade -y
sudo yum install gcc glibc-devel make ncurses-devel openssl-devel autoconf
cd /usr/local/src
sudo wget http://erlang.org/download/otp_src_R16B03-1.tar.gz
sudo tar zxvf otp_src_R16B03-1.tar.gz
cd otp_src_R16B03-1
@dhaneshkk
dhaneshkk / gist:9233694
Created February 26, 2014 17:02
download rebar executable and make available for all users
download rebar executable and make available for all users
=====================================
//root user
su
cd /usr/bin/
wget https://github.com/rebar/rebar/wiki/rebar
chmod 711 rebar
<!--
Web Application with Backbone: BEGINNER TUTORIAL
Backbone.js is a very popular and light(weight) JavaScript library
for building Web Applications.
However, learning it I found frustratingly few simple examples of
true workable applications with all lines of code explained.
Here is my attempt to hack the popular Jerome Gravel-Niquet's Backbone Todo App
@dhaneshkk
dhaneshkk / gist:9a823df4ea1defe0a537
Created February 13, 2015 21:35
Latest Vim on Ubnutu
1. add below lines in "/etc/apt/sources.list" file
deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse
2. sudo apt-get update
sudo apt-get remove --purge vim vim-runtime vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev mercurial libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo mkdir /usr/include/lua5.1/include
@dhaneshkk
dhaneshkk / heapsort.js
Last active August 29, 2015 14:26 — forked from Rosencrantz/heapsort.js
Heapsort example in javascript (i think)
var list = [9,1,7,3,4,2,8,0,5,6];
function chunk(list) {
var chunks = [];
for(var i=0; i<list.length; i++) {
if(list.length % 2 == 1 && i+1 == list.length) {
chunks.push(list[i]);
} else {
if(i % 2 == 0) {
chunks.push(Math.max(list[i], list[i+1]));