Skip to content

Instantly share code, notes, and snippets.

View sysarcher's full-sized avatar
🦀
learning everyday!!

T sysarcher

🦀
learning everyday!!
  • Germany
View GitHub Profile
@sysarcher
sysarcher / settings.json
Last active April 25, 2016 07:52
VS Code: set Vagrantfile to be rendered as Ruby (finally) (File > Preferences > User Settings)
{
"editor.insertSpaces": true,
"files.eol": "\n",
"files.associations": {
"Vagrantfile": "ruby"
}
}
@sysarcher
sysarcher / first-time.sh
Last active April 23, 2016 11:00
What I run on a fresh install
function getLastAptGetUpdate()
{
local -r aptDate="$(stat -c %Y '/var/cache/apt')"
local -r nowDate="$(date +'%s')"
echo $((nowDate - aptDate))
}
# Default To 24 hours
updateInterval="$((24 * 60 * 60))"
lastAptGetUpdate="$(getLastAptGetUpdate)"
@sysarcher
sysarcher / RescuePubkey.md
Created April 25, 2016 14:38
Given a Privake key file, get (hopefully) *your* public key back.

Purpose

Get a lost public key back from a private key in Linux

Generate public key from private

ssh-keygen -y -f my_private_key > ./my_private_key.pub

Permissions

Sometimes, linux complains about very open permissions... a chmod 0400 my_private_key should shut her up!

@sysarcher
sysarcher / pb2js.py
Created June 11, 2016 11:00
convert between Google Protobuf and JSON. **I don't know where this code originally came from but this is sooo useful!**
'''
Provide serialization and de-serialization of Google's protobuf Messages into/from JSON format.
'''
# groups are deprecated and not supported;
# Note that preservation of unknown fields is currently not available for Python (c) google docs
# extensions is not supported from 0.0.5 (due to gpb2.3 changes)
import json # py2.6+ TODO: add support for other JSON serialization modules
@sysarcher
sysarcher / update-apt.sh
Created July 26, 2016 22:32
Skip `apt-get update` if you've recently updated cache
function getLastAptGetUpdate()
{
local -r aptDate="$(stat -c %Y '/var/cache/apt')"
local -r nowDate="$(date +'%s')"
echo $((nowDate - aptDate))
}
# Default To 24 hours
updateInterval="$((24 * 60 * 60))"
lastAptGetUpdate="$(getLastAptGetUpdate)"
@sysarcher
sysarcher / local.conf.sh
Last active March 8, 2017 15:00
local.conf for standard ostro-os build (tested on Intel Galileo)
#
# This file is your local configuration file and is where all local user settings
# are placed. The comments in this file give some guide to the options a new user
# to the system might want to change but pretty much any configuration option can
# be set in this file.
#
# Lines starting with the '#' character are commented out and in some cases the
# default values are provided as comments to show people example syntax. Enabling
# the option is a question of removing the # character and making any change to the
# variable as required.
@sysarcher
sysarcher / mergesort.fs
Created December 29, 2016 22:14
Scala and F# implementation of mergesort
let rec mergesort (xs: list<int>) =
let rec merge (xs: list<int>, ys: list<int>) =
match (xs, ys) with
| ([], ys) -> ys
| (xs, []) -> xs
| (x::xs1, y::ys1) ->
if(x < y) then x::merge(xs1, ys)
else y::merge(xs, ys1)
let n = xs.Length / 2
if (n = 0) then xs
@sysarcher
sysarcher / README.md
Created August 21, 2017 09:11 — forked from kergoth/README.md
Quick prototype of a variable filtered bitbake -e

bitbake-env: improved version of bitbake -e

To install

The script may be run from anywhere, as long as 'bitbake' can be found in your PATH.

Suggestion: alias bbe=bitbake-env

@sysarcher
sysarcher / vmx.S
Created November 16, 2017 14:24 — forked from pdumais/vmx.S
#include "macros.h"
#include "vmx.h"
#include "../memorymap.h"
#define VMWRITE(A,B) mov B,%rbx; mov A,%rax; vmwrite %rbx,%rax
#define VMREAD(A) mov A,%rbx; vmread %rbx,%rax
.global init_hypervisor
.global create_vm

Keybase proof

I hereby claim:

  • I am sysarcher on github.
  • I am sysarcher (https://keybase.io/sysarcher) on keybase.
  • I have a public key whose fingerprint is 9370 712D 478E 5246 83AD 00CD 62B6 F20E 5D35 9984

To claim this, I am signing this object: