Skip to content

Instantly share code, notes, and snippets.

View umardx's full-sized avatar
🏠
Working from home

Umar Nawawi umardx

🏠
Working from home
View GitHub Profile

Change python version system-wide

To change python version system-wide we can use update-alternatives command. Logged in as a root user, first list all available python alternatives:

# apt-get update
# apt-get install python3.6
# update-alternatives --list python
update-alternatives: error: no alternatives for python

The above error message means that no python alternatives has been recognized by update-alternatives command.

Cisco IOS XE CSR1000v

Configuring NETCONF

Example:

username admin privilege 15 secret admin
!
interface GigabitEthernet1
  ip address 10.10.0.240 255.255.240.0
  no shutdown

First, find out where pipenv has created your virtualenv setup and stashed the python executable you are using. From the command line in your project folder (where your Pipfile is), execute the following:

pipenv --py

This will give you the full path to your virtualenv python install. For my sample project it was:

VIRTUALENV_PYTHON_PATH_HERE=C:\Users\UmarDx\.virtualenvs\api-9dSW7b5h\Scripts\python.exe

Now, create a local settings file that VS Code will use for your project

@umardx
umardx / softether.sh
Created February 27, 2018 16:00 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/usr/local/env bash
# Update system
apt-get update && apt-get -y upgrade
# Get build tools
apt-get -y install build-essential wget curl
# Define softether version
RTM=$(curl http://www.softether-download.com/files/softether/ | grep -o 'v[^"]*e' | grep rtm | tail -1)
IFS='-' read -r -a RTMS <<< "${RTM}"
@umardx
umardx / test_inbound_ports.md
Last active June 27, 2023 14:02
Assume there are two servers 192.168.1.1 as the tester, and 172.16.8.1 as the target. We will test which open inbound ports on the target server.

Assume there are two servers 192.168.1.1 as the tester, and 172.16.8.1 as the target. We will test which open inbound ports on the target server.

Firewall Case

PREROUTE all traffic from IP 192.168.1.1/32 to port 127.0.0.1:80

iptables -t nat -A PREROUTING -s 192.168.1.1/32 -p tcp -m tcp --dport 80 -j RETURN
iptables -t nat -A PREROUTING -s 192.168.1.1/32 -p tcp -j DNAT --to-destination :80
@umardx
umardx / vpnclient
Created January 29, 2018 09:40 — forked from legokichi/vpnclient
softether vpn client for ubuntu /etc/init.d/vpnclient
#! /bin/sh
### BEGIN INIT INFO
# Provides: vpnclient
# Required-Start: $all
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start VPN Client at boot time
# chkconfig: 345 44 56
# description: Start VPN Client at boot time.

I have the some issue.

When I run the ee site create command I get this:

Running pre-update checks, please wait... Setting up NGINX configuration [Done] Setting up webroot [Done] Downloading WordPress [Fail] Oops Something went wrong !! Calling cleanup actions ...

@umardx
umardx / vpn-autoinstall.sh
Created August 28, 2017 00:26
OpenVPN autoinstall.sh
#!/bin/bash
# OpenVPN road warrior installer for Debian, Ubuntu and CentOS
# This script will work on Debian, Ubuntu, CentOS and probably other distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want to setup a VPN on
# your Debian/Ubuntu/CentOS box. It has been designed to be as unobtrusive and
# universal as possible.
@umardx
umardx / mount_qcow2.md
Created August 11, 2017 06:09 — forked from shamil/mount_qcow2.md
How to mount a qcow2 disk image

How to mount a qcow2 disk image

This is a quick guide to mounting a qcow2 disk images on your host server. This is useful to reset passwords, edit files, or recover something without the virtual machine running.

Step 1 - Enable NBD on the Host

modprobe nbd max_part=8
@umardx
umardx / openvpn_docker.md
Last active July 1, 2018 05:49
Setup own VPN server in 15 minutes with Docker

It’s VERY easy to setup your own VPN with docker. This guide assumes you’re ok with operating a linux box but know nothing about docker. I’ll break it down into easy steps:

Setup a docker host

Install docker on the host:

$ curl -sSL https://get.docker.com/ | sh

Run the docker image

Make directory for docker volume:

$ mkdir $HOME/openvpn-data