Skip to content

Instantly share code, notes, and snippets.

View Doom4535's full-sized avatar

Aaron Covrig Doom4535

  • Walla Walla University
View GitHub Profile
@TooTallNate
TooTallNate / crc.js
Created April 28, 2011 16:53
Modbus Serial RTU CRC Algorithm
var data;
process.stdin.on('data', function(chunk) {
data = chunk
});
process.stdin.on('end', function() {
console.log(data);
var givenCrc = data.slice(data.length-2);
givenCrc = (data[1] << 7 | data[0]);
console.log(givenCrc);
@robinsmidsrod
robinsmidsrod / _INSTALL.md
Last active June 10, 2024 09:16
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

int64_t ipow(int64_t base, uint8_t exp) {
static const uint8_t highest_bit_set[] = {
0, 1, 2, 2, 3, 3, 3, 3,
4, 4, 4, 4, 4, 4, 4, 4,
5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 6,
6, 6, 6, 6, 6, 6, 6, 255, // anything past 63 is a guaranteed overflow with base > 1
@max-mapper
max-mapper / readme.md
Last active June 3, 2020 00:31
automatically scan for and join open internet enabled wifi networks on linux using node.js (tested on raspberry pi raspbian)
@john-clark
john-clark / i.pxe
Last active February 27, 2023 21:46
ipxe php boot system
#!ipxe
#
# This file gets compiled into undionly.kpxe
################################################################
:vars
set next-server 192.168.2.121
cpuid --ext 29 && set arch amd64 || set arch x86
:netconfig
dhcp net0 || goto ipxeshell
:prompt
@raelgc
raelgc / Email Server (Linux, Unix, Mac).md
Last active June 5, 2024 04:06
Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

Setup a Local Only SMTP Email Server (Linux, Unix, Mac)

1 - Point localhost.com to your machine

Most of programs will not accept an email using just @localhost as domain. So, edit /etc/hosts file to make the domain localhost.com point to your machine, including this content to the file:

127.0.0.1 localhost.com

2 - Install Postfix

@artizirk
artizirk / sendsms.sh
Last active December 3, 2022 20:41
send sms with ppp chat program
#!/bin/ash
#using: sendsms +375555555 "some text i want to send"
TELFNUMB=$1
SMSTEXT=$2
MODEM="/dev/ttyUSB1"
#reg to the network (maybe not needed)
gcom reg -d $MODEM
@schickling
schickling / Rakefile
Last active January 31, 2024 23:00
Activerecord without Rails
require "active_record"
namespace :db do
db_config = YAML::load(File.open('config/database.yml'))
db_config_admin = db_config.merge({'database' => 'postgres', 'schema_search_path' => 'public'})
desc "Create the database"
task :create do
ActiveRecord::Base.establish_connection(db_config_admin)
@gitaarik
gitaarik / git_submodules.md
Last active June 13, 2024 21:34
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of usecases of submodules:

  • Separate big codebases into multiple repositories.
@payne92
payne92 / gist:11090057
Created April 19, 2014 16:49
getch() function to read single char from stdin, w/o waiting for newline (Windows and Unix)
# If Windows getch() available, use that. If not, use a
# Unix version.
try:
import msvcrt
getch = msvcrt.getch
except:
import sys, tty, termios
def _unix_getch():
"""Get a single character from stdin, Unix version"""