Skip to content

Instantly share code, notes, and snippets.

Avatar
🤓

Lewis Cowles Lewiscowles1986

🤓
View GitHub Profile
@Lewiscowles1986
Lewiscowles1986 / dhcpcd.sh
Created Aug 21, 2017
Raspberry pi stretch allow dhcpcd5 with /etc/network/interfaces
View dhcpcd.sh
#!/bin/sh -e
#
# This file belongs in /usr/lib/dhcpcd5/dhcpcd how you get it there is up to you
#
DHCPCD=/sbin/dhcpcd
INTERFACES=/etc/network/interfaces
REGEX="^[[:space:]]*iface[[:space:]](*.*)[[:space:]]*inet[[:space:]]*(dhcp|static)"
EXCLUDES=""
@Lewiscowles1986
Lewiscowles1986 / rPi3-ap-setup.sh
Last active Oct 20, 2020
Raspberry Pi 3 access-point-setup
View rPi3-ap-setup.sh
#!/bin/bash
#
# This version uses September 2017 august stretch image, please use this image
#
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
View benchmark-pc.c
// Integer and float benchmark for Win32 and Win64
// Results are below main(), line 91
#include <stdlib.h>
#include <stdio.h>
#ifdef _WIN32
#include <sys/timeb.h>
#else
#include <sys/time.h>
#endif
@Lewiscowles1986
Lewiscowles1986 / README.md
Last active Jun 13, 2020 — forked from lttlrck/gist:9628955
rename git branch locally and remotely
View README.md

Git Rename Script

This is a fork of https://gist.github.com/lttlrck/9628955 to make the renaming of branches simpler.

Usage

  1. Ensure the script is executable.
  2. git-rename.sh [oldbranchname] newbranchname [upstreamname]

conventions

@Lewiscowles1986
Lewiscowles1986 / dh-diagram.svg
Last active May 18, 2020
SSH with asymmetric key UML Sequence
View dh-diagram.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Lewiscowles1986
Lewiscowles1986 / grub.cfg
Last active May 14, 2020
multiboot USB Linux goodness
View grub.cfg
# This grub.cfg file was created by Lance http://www.pendrivelinux.com
# Suggested Entries and the suggestor, if available, will also be noted.
set timeout=10
set default=0
set gfxpayload=keep
submenu "Ubuntu" {
menuentry "Ubuntu Desktop ISO" {
set isofile=/ubuntu.iso
@Lewiscowles1986
Lewiscowles1986 / rPi3-mariadb-10.1.sh
Last active May 14, 2020
Raspberry Pi MariaDB 10.1 with Galera Cluster build
View rPi3-mariadb-10.1.sh
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Must be root"
exit
fi
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
View install-vscodium-64-bit-update-after-download.sh
#!/bin/bash
sudo tar -xzf ~/Downloads/VSCodium-linux-x64*.tar.gz -C . && rm ~/Downloads/VSCodium-linux-x64*
View Build and push to dockerhub
name: Docker Image CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
@Lewiscowles1986
Lewiscowles1986 / math_spelunk.c
Created Mar 3, 2020
Spelunking through math.h to try to find understanding
View math_spelunk.c
#include<stdio.h>
#include<math.h>
#include <stdint.h>
#include <string.h>
#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define for_endian(size) for (int i = 0; i < size; ++i)
#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define for_endian(size) for (int i = size - 1; i >= 0; --i)
You can’t perform that action at this time.