Skip to content

Instantly share code, notes, and snippets.

View awabcodes's full-sized avatar

Awab Abdoun awabcodes

View GitHub Profile
@awabcodes
awabcodes / ipsec-config.md
Last active June 18, 2022 21:31
[IPSEC Config] #ipsec #tunnel #vpn

Installation

sudo apt install strongswan

Config

Enable packet forwarding

sudo nano /etc/sysctl.conf
@awabcodes
awabcodes / samba-config.md
Created June 18, 2022 21:05
[SAMBA Config] #samba #nas

Installation

sudo apt install samba samba-common-bin

Config file

/etc/samba/smb.conf
@awabcodes
awabcodes / ps4-pkg-sender.md
Created June 18, 2022 20:26
[PS4 pkg sender] send pkg files to your ps4 #ps4
@awabcodes
awabcodes / wireguard-server-setup.md
Last active June 18, 2022 20:55
[Wireguard Server Setup] #wireguard #vpn #linux

Server setup

Installation

sudo apt install wireguard

Generate wireguard key pair

wg genkey | sudo tee /etc/wireguard/privatekey | wg pubkey | sudo tee /etc/wireguard/publickey
@awabcodes
awabcodes / systemd-service-config.md
Last active June 18, 2022 20:42
[Systemd Config] #systemd #linux #systemd_service

Create a systemd service

sudo nano /etc/systemd/system/webapp.service
[Unit]
Description=Webapp Service
[Service]
User=username
@awabcodes
awabcodes / apache-reverse-proxy.md
Last active June 18, 2022 21:39
[Apache Config] #apache #server #config #reverse_proxy #virtual_host #certbot #letsencrypt

Apache Config

Installation

sudo apt update
sudo apt install apache2

Creating the Directory

sudo mkdir -p /var/www/example.com
@awabcodes
awabcodes / regex.js
Last active July 19, 2020 10:44
[Regular Expressions] #Regex
// regex for sudanese mobile numbers
const mobileRegex = /^(?:\+249|00249|249|0)?(\d{9})$;
@awabcodes
awabcodes / dockercommands.md
Last active June 18, 2022 21:17
[Docker Commands] #docker

Installation

sudo apt install ca-certificates curl gnupg lsb-release

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
 
@awabcodes
awabcodes / opensslcommands.sh
Last active June 24, 2019 06:22
[OpenSSL Commands] #OpenSSL
# Extracting the CA Certificate using OpenSSL
openssl s_client -connect <your.dsm.name.com:8443> –showcerts
# Export certificate to .der format
openssl x509 -outform der -in <xyz.pem> -out <xyz.der>
@awabcodes
awabcodes / keytoolcommands.sh
Created January 24, 2019 07:56
[Keytool Commands] #keytool #java
# List the content of cacerts
$ echo 'changeit' | keytool -list -v -keystore $(find $JAVA_HOME -name cacerts) | grep 'Owner:'
# List the content of a Keystore
$ keytool -list -v -keystore <keystore.jks>
# View Certificate Information
keytool -printcert -file <domain.crt>
# Generate Keys in New/Existing Keystore