Skip to content

Instantly share code, notes, and snippets.

Mike Acton macton

Block or report user

Report or block macton

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@macton
macton / cgi-proxy.c
Created Feb 5, 2012
Quick and dirty cgi proxy in C using curl
View cgi-proxy.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ccgi.h>
#include <curl/curl.h>
static size_t
WriteMemoryCallback(void *ptr, size_t size, size_t nmemb, void *data)
{
size_t i;
@macton
macton / linux_tips.txt
Last active Dec 13, 2015
Random Linux tips
View linux_tips.txt
-------------------------------------------------------------------------------------------------------------
View process memory info
$ cat /proc/<process_id>/smaps
-------------------------------------------------------------------------------------------------------------
Overall memory info
http://stackoverflow.com/a/13754307
$ smem
-------------------------------------------------------------------------------------------------------------
View .bash_profile
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
View README.md

Run like so:

node gist-clone-all.js username

You'll want to replace "username" with your own username.

This script clones using the push URL, so you should probably be the owner of the gists. You could also use this to clone someone else's gists, but in that case you may wish to edit the code to use gist_pull_url instead.

@macton
macton / chromebook_tips.txt
Last active Apr 4, 2016
Random tidbits for Chromebook
View chromebook_tips.txt
---------------------------------------------------------------------------------------------------
Turn off power down on time out
Turn off power down on lid close
$ sudo stop powerd
---------------------------------------------------------------------------------------------------
Open port 22 for ssh
$ sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT
---------------------------------------------------------------------------------------------------
Set hostname
$ sudo hostname <new-hostname>
@macton
macton / smbmount
Last active Oct 28, 2016
smb mount linux
View smbmount
References:
[0] http://www.tldp.org/HOWTO/SMB-HOWTO-8.html
[1] http://www.cyberciti.biz/tips/how-to-mount-remote-windows-partition-windows-share-under-linux.html
[2] http://stackoverflow.com/questions/6734400/what-does-cifs-mount-failed-w-return-code-22-indicate
debian
$ sudo apt-get install smbclient
$ sudo apt-get install cifs-utils
$ sudo mkdir /mnt/something
$ sudo mount -t cifs //host/something -o username=user@domain.com,password=psswd /mnt/something
View git_cheatsheet.txt
Git cheatsheets
---------------
http://www.cheat-sheets.org/saved-copy/git-cheat-sheet.pdf
http://alvinalexander.com/git/git-cheat-sheet-git-reference-commands
Git concepts
------------
Repository - Collection of commit history of files being managed (not directories)
Working directory - Files in local file system (may or may not be tracked)
@macton
macton / 00 win8_tips.txt
Last active Dec 23, 2016
Windows 8 Tips
View 00 win8_tips.txt
Tips for Windows 8
View style.css
// Simple, readable style.css template
body {
font-family: "Georgia", "Verdana", "Lucida Grande", sans-serif;
margin: 20px auto;
width: 95%;
font-size: 70%;
line-height: 1.4;
}
View mingw-clang-build
Installation steps for getting a functional Clang++ build running on Windows 8 and MinGW.
See:
- http://www.bencode.net/blog/2012/10/20/clangonwindows/
- http://sourceforge.net/p/mingw/bugs/2043/
Steps:
1. Assumes mingw and gcc installed.
a. http://sourceforge.net/projects/mingw/files/Installer/mingw-get-inst/
b. Add c:\mingw\bin to PATH
You can’t perform that action at this time.