Skip to content

Instantly share code, notes, and snippets.

@alansparrow
alansparrow / sshing
Created September 26, 2014 17:56
check who is sshing
netstat -tnpa
@alansparrow
alansparrow / raspberrypiaccesspoint
Last active August 29, 2015 14:06
raspberry pi access point
1. Install driver nl80211
http://wireless.kernel.org/en/users/Documentation/hostapd
1.1 Fix missing lib
sudo apt-get install libssl-dev
sudo apt-get install libnl-dev
1.2 Copy hostapd to /usr/sbin and chmod
sudo cp hostapd /usr/sbin (remember to backup the old)
To run node.js on the BeagleBone, it needs to be compiled from scratch or you can install a precompiled distribution available on the downloads page. While it seems to be more common to cross-compile for the ARM, I find it easier to natively compile it on the BeagleBone, but it does take a bit longer.
Note that I compile and install as root sudo su, so if you get any differing result, keep this in mind.
Step 1: Prerequisites
We will need a compiler to compile the node source. The build requires python for the configuration scripts and gcc for the actual code.
# apt-get install python
@alansparrow
alansparrow / highlightvim
Created September 25, 2014 17:57
Highlight Vim
https://wiki.debian.org/vim
Vim supports syntax highlighting. To activate it open up
/etc/vim/vimrc
and uncomment the line
" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
@alansparrow
alansparrow / keyboard raspberry
Created September 25, 2014 17:49
keyboard raspberry
setxkbmap -layout us (run it after you run startx)
http://www.raspberrypi.org/forums/viewtopic.php?f=50&t=40294
@alansparrow
alansparrow / userlocalbin
Created September 9, 2014 21:41
/usr/local/bin
http://superuser.com/questions/717663/permission-denied-when-trying-to-cd-usr-local-bin-from-terminal
@alansparrow
alansparrow / gist:ce6df2e0cbe1fef9dd7b
Created August 28, 2014 16:11
run bash in docker
docker run -i -t ubuntu /bin/bash
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <signal.h>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">