Skip to content

Instantly share code, notes, and snippets.

View alkavan's full-sized avatar
😀
sup?

Igal Alkon alkavan

😀
sup?
View GitHub Profile
@alkavan
alkavan / funtoo-install
Created May 4, 2012 09:14
Install inscructions for Funtoo/Gentoo Linux
# Install vmware x11 video driver
emerge -va x11-drivers/xf86-video-vmware
@alkavan
alkavan / set-mouse-to-human-sensitivity.sh
Created November 25, 2012 19:00
script for setting mouse sensitivity to human speed on fedora 17
#!/bin/bash
# if you need to set mouse sensitivity on X or gnome3 to value lower than the
# mouse configuration utility provides, this is the script for you.
# script built for fedora 17, but it should work for some other distros as well.
echo -e "\ncheck the 'id' of you mouse device ...\n"
xinput
echo "---- ---- ---- ----"
@alkavan
alkavan / Makefile
Created December 7, 2012 18:44
basic makefile for c++ project
# basic makefile for c++ project
SOURCE=main.cpp your_include.h
MYPROGRAM=shellgap
MYINCLUDES=
MYLIBRARIES=
CC=g++
#------------------------------------------------------------------------------
@alkavan
alkavan / static_and_dynamic_dispatch.cpp
Last active October 14, 2015 01:17 — forked from anonymous/static and dynamic dispatch in C++
great explanation by Alan Johnson about static and dynamic dispatch in C++.
/*
* @link http://stackoverflow.com/questions/13600934/why-is-the-virtual-keyword-needed
* @author Alan Johnson
* > Hi,
* >
* > Can someone explain to me what static and dynamic dispatch are and what
* > the difference is between the two? Do this even occurr in C++?
* >
* > Thanks
*

Copy entire database into another one mysqldump -u [user] -p[pass] [source_db] | mysql -u [user] -p[pass] [target_db]

wget -O data.xml --auth-no-challenge --user=<username> --password=<password> https://my.api.url.com/apiDownloadFile
# Generic Makefile for compiling an executable, with pkg-config dependencies.
CC := clang
PKGS := gtk+-3.0
SRCDIR := src
BUILDDIR := build
CFLAGS := -g -Wall `pkg-config --cflags $(PKGS)`
LIBS := `pkg-config --libs $(PKGS)`
TARGET := app
@alkavan
alkavan / git_commands.md
Last active December 17, 2015 05:39
List of useful GIT commands.

Clean staging area

Remove all deleted files from staging area

git diff --diff-filter=D --name-only -z | xargs -0 git rm

SVN import/export

Read svn author

#!/bin/bash
sudo yum install gcc make php-devel geoip geoip-devel
sudo pecl install geoip
ls /usr/lib64/php/modules/geoip.so
echo -e "; Enable geoip extension module\nextension=geoip.so\n" >> /etc/php.d/geoip.ini
echo -e "Done installing GeoIP PHP extention!\n"
@alkavan
alkavan / import_db.sh
Last active December 21, 2015 06:19
Script to import MySQL databases from dumps
#/bin/bash
# Export databases first with the following command:
# mysqldump -u user -p db-name > db-name.dbd
# Configure your new database
file_ext=".dbd"
db_user="root"
db_pass="myrootpassword"