Skip to content

Instantly share code, notes, and snippets.

View eknowlton's full-sized avatar
🐧

Ethan Knowlton eknowlton

🐧
View GitHub Profile
@sebsto
sebsto / gist:6af5bf3acaf25c00dd938c3bbe722cc1
Last active May 17, 2024 12:40
Start VNCServer on Mac1 EC2 Instance
# YouTube (english) : https://www.youtube.com/watch?v=FtU2_bBfSgM
# YouTube (french) : https://www.youtube.com/watch?v=VjnaVBnERDU
#
# On your laptop, connect to the Mac instance with SSH (similar to Linux instances)
#
ssh -i <your private key.pem> ec2-user@<your public ip address>
#
# On the Mac
@jjsquady
jjsquady / nextjs-deploy.md
Last active June 9, 2024 12:23
Deploying NEXTJS site with nginx + pm2

How to setup next.js app on nginx with letsencrypt

next.js, nginx, reverse-proxy, ssl

1. Install nginx and letsencrypt

$ sudo apt-get update
$ sudo apt-get install nginx letsencrypt

Also enable nginx in ufw

@Northern-Lights
Northern-Lights / gotk-glade-test.go
Created November 24, 2018 17:25
How to use Glade UI builder in a Go/golang GTK application using gotk
package main
import (
"fmt"
"log"
"os"
"reflect"
"github.com/gotk3/gotk3/glib"
@sebgoa
sebgoa / kube.sh
Created September 5, 2018 14:16
cloud-init script to boostrap Kubernetes in a single VM
#!/bin/sh
set -e -x
apt-get --yes --quiet update
apt-get --yes --quiet install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
@dlangille
dlangille / pushovernet.sh
Last active October 19, 2019 01:42
using pam_exec to send pushover.net notifications of all logins (ssh, scp)
Credit to @feldpos for providing the original version of this file, designed for inclusion into a .bashrc etc file
$ ls -l /etc/pam.d/pushovernet.sh
-rwxr-xr-x 1 root wheel 485 Mar 22 14:48 /etc/pam.d/pushovernet.sh
$ cat /etc/pam.d/pushovernet.sh
#!/bin/sh
(if [ "${PAM_SM_FUNC}" == "pam_sm_open_session" ]; then
P_KEY="YOUR USER KEY HERE"
P_TOKEN="YOUR APP TOKEN HERE"
P_MSG="${PAM_USER} logged in to $(hostname) from ${PAM_RHOST} via ${PAM_SERVICE}"
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active June 12, 2024 14:34
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@mjnaderi
mjnaderi / install-arch.md
Last active June 13, 2024 23:27 — forked from mattiaslundberg/arch-linux-install
Installing Arch Linux with Full Disk Encryption (LVM on LUKS)

Installing Arch Linux with Full Disk Encryption

If you're aiming for a seamless Arch Linux installation in UEFI mode, follow along as this guide will walk you through the process step by step. We'll be using LUKS (Linux Unified Key Setup) and LVM (Logical Volume Manager) partitions on LUKS to achieve full disk encryption.

Note: I have updated this doc for UEFI mode. For those with BIOS/MBR systems, you can refer to the previous version, but keep in mind that it might be outdated and no longer accurate.

If you're only interested in installing Linux and not setting up dual boot with Windows, feel free to skip the Windows-related sections.

@ansulev
ansulev / install-arch-linux-on-btrfs-subvolume-inside-luks
Last active December 18, 2023 06:45
Install Arch Linux with full encrypted btrfs subvolume inside luks
# Install Arch Linux with full encrypted btrfs subvolume inside luks
# Hardware: BIOS system, Intel GPU, Nvidia Optimus, Toshiba SSD, Wifi
# Please adjust for your needs.
# filename: install-arch-linux-on-btrfs-subvolume-inside-luks.txt
# The official guide: https://wiki.archlinux.org/index.php/Installation_Guide
# Download the archiso image from https://www.archlinux.org/download/
# Copy to a usb-drive
dd bs=4M if=archlinux.iso of=/dev/sdx status=progress oflag=sync # on linux
@miticojo
miticojo / syslog_rfc_regex.js
Created September 3, 2016 08:32
Regex for SYSLOG format RFC3164 and RFC5424
// RFC3164 https://www.ietf.org/rfc/rfc3164.txt (obsolete)
var regex_rfc3164 = /([A-Z][a-z][a-z]\s{1,2}\d{1,2}\s\d{2}[:]\d{2}[:]\d{2})\s([\w][\w\d\.@-]*)\s(.*)$/;
// RFC5424 https://www.ietf.org/rfc/rfc3164.txt
var regex_rfc5424 = /(?:(\d{4}[-]\d{2}[-]\d{2}[T]\d{2}[:]\d{2}[:]\d{2}(?:\.\d{1,6})?(?:[+-]\d{2}[:]\d{2}|Z)?)|-)\s(?:([\w][\w\d\.@-]*)|-)\s(.*)$/;
// valid string for regex test
var msg_rfc3164 = "<34>Oct 11 22:14:15 mymachine su: 'su root' failed for lonvick on /dev/pts/8";
var msg_rfc5424 = "<34>1 2003-10-11T22:14:15.003Z mymachine.example.com su - ID47 - BOM'su root' failed for lonvick on /dev/pts/8";
@SalahAdDin
SalahAdDin / Steps.md
Last active May 29, 2022 06:11
Instlling React-Native Android Environment in ArchLinux

First step: Install Android SDK

  1. yaourt -S android-sdk android-sdk-platform-tools android-sdk-build-tools
    Note: Maybe you'll have problems with the lasta package: ncurses5-compat-libs. In order to avoid this problem you have to use this command: gpg --recv-keys F7E48EDB. You can find clarification here.
  2. yaourt -S genymotion
    Note: You'll need install virtual-box and his modules, yaourt will make for you but you need choos between ArchLinux host modules or DKMS host modules.
  3. Enter in super user mode with su - and then do echo -e "vboxdrv\nvboxnetflt\nvboxnetadp\nvboxpci" > /etc/modules-load.d/virtualbox.conf
    Note: You need do this with super user because need super user permissions and with sudo, for us at least, doesn't work.
  4. sudo modprobe vboxdrv vboxnetadp vboxnetflt
    Activate for current session.
  5. sudo chmod -R 777 /opt/android-sdk