Skip to content

Instantly share code, notes, and snippets.

View geofmureithi-zz's full-sized avatar

Njuguna Mureithi geofmureithi-zz

View GitHub Profile
@geofmureithi-zz
geofmureithi-zz / Counter.riot
Last active July 31, 2020 20:11
Counter Example using rust and riot.js
<app>
<script type="rust" module="counter">
use serde::{Serialize, Deserialize};
#[derive(Serialize, Deserialize)]
pub struct CounterState {
counter: i32
}
impl Default for CounterState {

Signing a custom kernel for Secure Boot

Mainly From: https://github.com/jakeday/linux-surface/blob/master/SIGNING.md

Instructions are for ubuntu, but should work similar for other distros, if they are using shim and grub as bootloader. If your distro is not using shim (e.g. Linux Foundation Preloader), there should be similar steps to complete the signing (e.g. HashTool instead of MokUtil for LF Preloader) or you can install shim to use instead. The ubuntu package for shim is called shim-signed, but please inform yourself on how to install it correctly, so you do not mess up your bootloader.

@geofmureithi-zz
geofmureithi-zz / lib.rs
Last active May 11, 2020 10:38
Actix + Postgres Notification
pub mod notify {
use actix::prelude::*;
use serde::{Deserialize, Serialize};
use futures::{
channel::mpsc, future, stream, StreamExt, TryStreamExt, FutureExt, TryFutureExt
};
use tokio_postgres::{
tls::NoTls, AsyncMessage, Config, Notification
@geofmureithi-zz
geofmureithi-zz / scrapper.sh
Created November 1, 2017 11:36
Website Scrapper
!/bin/bash
# Require the URI of a website to be downloaded
if [ -z "$1" ]; then
echo "Usage: scrapper.sh [URL]..."
exit 0
fi
dest=""
dest=$(date +%F--%T)
@geofmureithi-zz
geofmureithi-zz / issue_template.md
Created February 6, 2017 09:47
Github Issue Template

[provide general introduction to the issue logging and why it is relevant to this repository]

Context

[provide more detailed introduction to the issue itself and why it is relevant]

Process

[ordered list the process to finding and recreating the issue, example below]

@geofmureithi-zz
geofmureithi-zz / README.md
Created February 6, 2017 09:27 — forked from auremoser/README.md
Github Issue Template

This template is my ideal format for issues submitted to a github repository.

@geofmureithi-zz
geofmureithi-zz / .env.travis
Created December 28, 2016 15:12 — forked from gilbitron/.env.travis
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.2/angular.min.js"></script>
<script
src="http://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.1/ui-bootstrap-tpls.min.js">
</script>
<?php
trait Loggable {
public function log($event) {
printf("Event: '%s', source: '%s'\n",
event, get_class($this));
}
}
class User {
use Loggable;
@geofmureithi-zz
geofmureithi-zz / pretty-json.php
Created April 20, 2016 16:49
Pretty-print a JSON string in PHP.
<?php
/**
* Formats a JSON string for pretty printing
*
* @param string $json The JSON to make pretty
* @param bool $html Insert nonbreaking spaces and <br />s for tabs and linebreaks
* @return string The prettified output
* @author Jay Roberts
*/