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 / cpuid_features.c
Last active Aug 20, 2019
Print cpuid features
View cpuid_features.c
// See: Intel Intrinsics Guide https://software.intel.com/sites/landingpage/IntrinsicsGuide/
// See: CPUID Explorer http://www.flounder.com/cpuid_explorer1.htm
// See: Playing with cpuid http://newbiz.github.io/cpp/2010/12/20/Playing-with-cpuid.html
// See: MSDN __cpuid, __cpuidex http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
// See: Notes on MMX/SSE and a searchable table of intrinsics. http://www.taffysoft.com/pages/20120418-01.html
// See: AMD CPUID Specification http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/25481.pdf
#if defined(__GNUC__)
#include <stdint.h>
#include <cpuid.h>
@macton
macton / 00_webapp_tips.txt
Last active Jul 18, 2019
random webapp tips
View 00_webapp_tips.txt
Cross-domain file load in jsfiddle
http://jsfiddle.net/jgpSy/
------------------------------------------------
Using jquery.treeview + angular.js
- Dynamically loading json description of tree
- Building DOM with angular
- Calling $.treeview after DOM contructed.
500 items: http://jsfiddle.net/eaq2V/
5000 items: http://jsfiddle.net/Qkh9y/
View Setup Raspberry Pi 3.txt
Enabling SSH
https://learn.adafruit.com/adafruits-raspberry-pi-lesson-6-using-ssh/enabling-ssh
Connecting to WPA2-Enterprise Wifi Network
https://raspberrypi.stackexchange.com/a/24670
How to Mount an External Hard Drive on the Raspberry Pi
https://www.modmypi.com/blog/how-to-mount-an-external-hard-drive-on-the-raspberry-pi-raspian
(chroot) Install common stuff
View vim_tips.txt
----------------------------------------------------------------------------------------------------------------
Find & Replace non-printable characters in vim
http://durgaprasad.wordpress.com/2007/09/25/find-replace-non-printable-characters-in-vim/
1) Find hexa value of that non-printable character. Move your cursor to that character and press ‘ga’.
2) In escape mode, execute this ‘:%s/\%x85/\r/gc’. In my case, hexadecimal value of that non-printable character is 85. I replaced that with ‘\r’.
----------------------------------------------------------------------------------------------------------------
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
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;
}
@macton
macton / 00 win8_tips.txt
Last active Dec 23, 2016
Windows 8 Tips
View 00 win8_tips.txt
Tips for Windows 8
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 / 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
@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>
You can’t perform that action at this time.