Skip to content

Instantly share code, notes, and snippets.

View bgunebakan's full-sized avatar

Bilal Tonga bgunebakan

View GitHub Profile
AddDefaultCharset UTF-8
<VirtualHost *:80>
ErrorLog /var/www/test/logs/error.log
CustomLog /var/www/test/logs/access.log combined
WSGIScriptAlias / /var/www/test/application.wsgi
Alias /robots.txt /var/www/test/robots.txt
sudo mount /dev/sda6 /mnt
sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys
sudo chroot /mnt
@bgunebakan
bgunebakan / wiegand.c
Last active August 29, 2015 14:12 — forked from hsiboy/wiegand.c
/*
* Wiegand API Raspberry Pi
* By Kyle Mallory All rights reserved.
* 12/01/2013
* Based on previous code by Daniel Smith (www.pagemac.com) and Ben Kent (www.pidoorman.com)
* Depends on the wiringPi library by Gordon Henterson: https://projects.drogon.net/raspberry-pi/wiringpi/
*
* This is linked with -lpthread -lwiringPi -lrt
*
* The Wiegand interface has two data lines, DATA0 and DATA1. These lines are normall held
@bgunebakan
bgunebakan / datetime.c
Created January 6, 2015 20:24
get date and time with c
/* Simple C program that connects to MySQL Database server*/
#include <stdio.h>
#include <string.h>
#include <time.h>
int main(){
time_t t = time(NULL);
@bgunebakan
bgunebakan / mysql.c
Last active August 29, 2015 14:12
mysql c api test code
/* Simple C program that connects to MySQL Database server
*
* compile with $(mysql_config --cflags) mysql-c-api.c $(mysql_config --libs)
*dependencies: libmysql-dev mysql-client
*/
#include <mysql.h>
#include <stdio.h>
#include <string.h>
#include <time.h>
@bgunebakan
bgunebakan / gist:18c14e327e19a82deceb
Created February 11, 2015 14:04
find raspi on network
sudo nmap -sO 192.168.2.* -p22
#it will be shown as ;
Nmap scan report for 192.168.2.109
Host is up (0.00076s latency).
PROTOCOL STATE SERVICE
22 closed xns-idp
MAC Address: B8:27:EB:0C:FE:5A (Raspberry Pi Foundation)
@bgunebakan
bgunebakan / gist:aa85ded369e5aff1f452
Last active August 29, 2015 14:15
get ip address of interface.if interface does not exist i will return 'no connection interface'
import netifaces
satInterface = 'ppp0' #finding interface
interfaceList = netifaces.interfaces() #create interface list
if satInterface in interfaceList: #find interface in list
netifaces.ifaddresses(satInterface) #get ip
ip = netifaces.ifaddresses(satInterface)[2][0]['addr']
print ip
#uninstall pillow and PIL
pip install image
sudo apt-get install python-dev
sudo apt-get install python-imaging-tk
sudo apt-get install tk8.5-dev tcl8.5-dev
@bgunebakan
bgunebakan / cap5.txt
Created February 29, 2016 07:55
Solve error "make[3]: *** No rule to make target '/usr/lib64/perl5/CORE/EXTERN.h', needed by 'Cap5.o'. Stop."
# To workaround you can create link to ubuntu package folder
find /usr -name "EXTERN.h" # find perl lib folder maybe its different
sudo mkdir /usr/lib64
sudo ln -s /usr/lib/x86_64-linux-gnu/perl/5.20.2/ /usr/lib64/perl5
@bgunebakan
bgunebakan / wifi_raspi.conf
Last active May 8, 2016 21:18
raspberry pi 3 wifi static IP configuration
#wpa_supplicant
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB
network={
ssid="SSID NAME"
psk="PASS"
key_mgmt=WPA-PSK