Skip to content

Instantly share code, notes, and snippets.

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt update

sudo apt install openjdk-8-jdk-headless
@eldorplus
eldorplus / setup.sh
Created April 20, 2025 09:51 — forked from jjvillavicencio/setup.sh
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@eldorplus
eldorplus / socat-forward-tcp4-to-tcp6.sh
Created November 7, 2024 09:40 — forked from drmalex07/socat-forward-tcp4-to-tcp6.sh
Tunnel TCP traffic via socat. #socat
#!/bin/bash
set -e
listen_iface=${1}
listen_port=${2}
target_host=${3}
target_port=${4}
# Check non-empty
[[ -n "${listen_iface}" ]]
@eldorplus
eldorplus / unifi-debian11-install.sh
Created October 29, 2024 14:27 — forked from cloudnull/unifi-debian11-install.sh
Install the latest Unifi Controller on Debian 11
#!/usr/bin/env bash
set -ev
set -o pipefail
# Install dependencies
apt update
apt -y install apt-transport-https ca-certificates wget dirmngr gnupg gnupg2 software-properties-common
# Install old mongo (requried).

Running Unifi Controller in systemd-nspawn with cloud-init

This uses Ubuntu's server cloud image as a stateless container to run the UBNT Unifi Controller software. Configuration data is stored in a directory outside the container. Cloud-init is used to automatically set up the container image, so a new version can be dropped in with minimal effort. This should work with pretty much any modern Linux distro with systemd.

Setup

Systemd-nspawn prefers to store its machines on btrfs, so if your /var/lib/machines is not currently btrfs, you should create one and mount it there. Otherwise it will automatically create an image file at /var/lib/machines.raw and mount it.

Create a device

@eldorplus
eldorplus / encoded-20201212150102.txt
Created July 18, 2024 10:23 — forked from thegreatestminer/encoded-20201212150102.txt
MobaXTerm Professional x64 License Key [READ COMMENTS]
UEsDBBQAAAAIABNQjFGCf/GfLgAAACwAAAAHAAAAUHJvLmtleTMqdncpCXQOKDAp9woMzEo1MTVOrHAzTjTLME7VNs1LK8owTjQpcU8tcuLlAgBQSwECFAAUAAAACAATUIxRgn/xny4AAAAsAAAABwAAAAAAAAAAAAAAAAAAAAAAUHJvLmtleVBLBQYAAAAAAQABADUAAABTAAAAAAA=
@eldorplus
eldorplus / mongo-recommendations
Created April 15, 2022 06:51 — forked from thiagomgo/mongo-recommendations
MongoDB recommendations for CentOS 7 on AWS
vim /etc/udev/rules.d/85-ebs.rules
ACTION=="add|change", KERNEL=="xvdh", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="xvdi", ATTR{queue/scheduler}="deadline"
ACTION=="add|change", KERNEL=="xvdj", ATTR{queue/scheduler}="deadline"
vim /usr/lib/tuned/throughput-performance/tuned.conf
Change value "readahead" to 128
yum install -y numactl
chmod u+x /etc/rc.d/rc.local
@eldorplus
eldorplus / gencert.py
Created February 14, 2022 11:16 — forked from toolness/gencert.py
Python script to create server SSL certs and sign them with a custom CA.
#! /usr/bin/python
"""
This simple script makes it easy to create server certificates
that are signed by your own Certificate Authority.
Mostly, this script just automates the workflow explained
in http://www.tc.umn.edu/~brams006/selfsign.html.
Before using this script, you'll need to create a private
@eldorplus
eldorplus / selfsigned.py
Created February 14, 2022 11:16 — forked from bloodearnest/selfsigned.py
Create a self-signed x509 certificate with python cryptography library
# Copyright 2018 Simon Davy
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in