Skip to content

Instantly share code, notes, and snippets.

View AjkayAlan's full-sized avatar

Alan Kay AjkayAlan

View GitHub Profile
@AjkayAlan
AjkayAlan / OpenWrtRouterSetup.sh
Last active May 26, 2019 22:04
OpenWrtRouterSetup.sh
# ssh
ssh root@192.168.1.1
# Install stuff I care about
opkg update
opkg install luci
opkg install luci-app-sqm
opkg install luci-app-upnp
# Set new password for root
# Plug into USB to Ethernet Adapter, and install drivers for RTL8821CE
sudo apt-get install --reinstall git dkms build-essential linux-headers-$(uname -r)
git clone https://github.com/tomaspinho/rtl8821ce
cd rtl8821ce
chmod +x dkms-install.sh
chmod +x dkms-remove.sh
sudo ./dkms-install.sh
# Update everything
sudo apt-get update && sudo apt-get dist-upgrade -y
@AjkayAlan
AjkayAlan / UbiquitiERL3Setup.sh
Last active January 11, 2020 01:11
Setup for my basic settings with a Ubiquiti ERL 3 (EdgeRouter Lite 3)
# Plug in ethernet to eth0, connect to laptop, and set static IP to 192.168.1.10, subnet mask 255.255.255.0
# TODO: Script this so I dont need to touch the gui
# Navigate to 192.168.1.1, login using ubnt for username and password
# Run basic setup wizard, and set the following settings:
### Internet Port: eth0
### DHCP
### Enable the default firewall
### Enable DHCPv6 Prefix Delegation, /56, default firewall
### LAN port: eth1, enable dhcp
### Set password to whatever you want
@AjkayAlan
AjkayAlan / VSCodeSetup.md
Last active February 19, 2020 21:54
VSCodeSetup

My VSCode Setup

Install needed CLI tools

pip install flake8
pip install autopep8

Install Extensions

Prework

  1. Format your SD Card with FAT32 if <= 32GB, otherwise use exFAT
  2. Go to https://www.raspberrypi.org/downloads/raspberry-pi-os/ and the lite image, then unzip it
  3. Download https://www.balena.io/etcher/ and install it
  4. Use Etcher to write the downloaded image to the SD card
  5. Create a blank file named ssh into the boot partition to enable ssh with headless
  6. Put the SD card into your Raspberry Pi, plug it into ethernet, and power it on

SSH

@AjkayAlan
AjkayAlan / RaspberryPiDevSetup.sh
Last active May 21, 2022 15:58
Setup steps for my raspberry pi 3b+ for development
## Getting image and Pi up and running
# Go to https://www.raspberrypi.org/downloads/raspbian/ and download an image, then unzip it
# Download https://www.balena.io/etcher/ and install it
# Plug in microsd card, Unzip the downloaded image and use Etcher to write the downloaded image to the SD card
# Edit boot/config.txt, and uncomment hdmi_force_hotplug=1 and hdmi_drive=2
# Plug the PI in, and go through to setup prompts
# Run the following commands in terminal
## Config stuff
sudo raspi-config
@AjkayAlan
AjkayAlan / ChocoNewComputerSetup.ps1
Last active January 12, 2023 17:04
Installs Chocolatey and all the nice things I want
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco feature enable -n allowGlobalConfirmation
choco install googlechrome
choco install vlc
choco install microsoft-windows-terminal
choco install peazip
choco install vscode
choco install steam
choco install choco-upgrade-all-at --params "'/TIME:21:00'"
choco install origin

Quickstart

  • Plug WAN into eth1, LAN into eth2
  • Boot up, go to 192.168.88.1. Login with default creds.
  • Webfig -> System -> Reset Configuration. Wait for the reboot.
    • This makes it so you get good IPv6 firewall rules by default
  • In Quick Set:
    • Ensure Port is Eth1
    • Ensure Address Acquisition is Automatic
    • Set IP Address to 192.168.1.1
@AjkayAlan
AjkayAlan / OpenWrtSetupX86.sh
Last active March 27, 2024 13:28
Setup OpenWrt Snapshots on my x86 machine
# This assumes your already running OpenWRT
# Follow https://teklager.se/en/knowledge-base/openwrt-installation-instructions/ to get OpenWRT initally installed on an SSD if you haven't
# My device expects LAN on eth0, and WAN on eth1
# Sign into the router
ssh root@192.168.1.1
# Set vars
DOWNLOAD_LINK="https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/openwrt-23.05.3-x86-64-generic-squashfs-combined-efi.img.gz"
SHA256SUMS="https://downloads.openwrt.org/releases/23.05.3/targets/x86/64/sha256sums"
@AjkayAlan
AjkayAlan / WSLWindows10Setup.md
Last active April 6, 2024 10:02
Windows SubSystem For Linux setup that I like with some developers stuff mixed in

Setting Up WSL

Install A Distro:

  1. Run the following in powershell as admin Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

  2. Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)

  3. Open your distro you installed via the start menu, let it setup

  4. Update and upgrade

sudo apt-get update