Skip to content

Instantly share code, notes, and snippets.

View cjimti's full-sized avatar

Craig Johnston cjimti

View GitHub Profile
interface=uap0
ssid=testPiAP
hw_mode=g
channel=11
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=badpassword
wpa_key_mgmt=WPA-PSK
#!/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
iw dev wlan0 interface add uap0 type __ap
service dnsmasq restart
sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING -s 192.168.50.0/24 ! -d 192.168.50.0/24 -j MASQUERADE
ifup uap0
hostapd /etc/hostapd/hostapd.conf
interface=lo,uap0
no-dhcp-interface=lo,wlan0
bind-interfaces
server=8.8.8.8
domain-needed
bogus-priv
dhcp-range=192.168.50.50,192.168.50.150,12h
source-directory /etc/network/interfaces.d
auto lo
auto eth0
auto wlan0
auto uap0
iface eth0 inet dhcp
iface lo inet loopback
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID_OF_NETWORK"
psk="NETWORK_PASSWORD"
}
@cjimti
cjimti / Cassandra Create Table.cql
Last active August 25, 2016 18:27
A simple Cassandra create table example.
CREATE TABLE IF NOT EXISTS example.user (
user_id timeuuid PRIMARY KEY,
added_date timestamp,
first_name text,
last_name text,
email text
);
@cjimti
cjimti / Cassandra Table Create Alternative.cql
Last active August 25, 2016 18:27
An alternative primary key Cassandra table create.
CREATE TABLE IF NOT EXISTS example.user (
user_id timeuuid,
added_date timestamp,
first_name text,
last_name text,
email text,
PRIMARY KEY (user_id)
);
@cjimti
cjimti / Cassandra Create Table Composite Key.cql
Last active August 25, 2016 18:26
Cassandra create table with composite key.
CREATE TABLE IF NOT EXISTS example.user (
user_id timeuuid,
added_date timestamp,
first_name text,
last_name text,
email text,
PRIMARY KEY ((first_name,last_name,email))
);
@cjimti
cjimti / Cassandra Create Table with Clustering.cql
Created August 25, 2016 18:24
Cassandra Create Table with Clustering
CREATE TABLE example_clustering (
comment text,
added timestamp,
user_id uuid,
PRIMARY KEY ((comment), added)
) WITH CLUSTERING ORDER BY ( added DESC );
5008
9201
300
1857
5001
5007
5009
5003
9203
1834