Skip to content

Instantly share code, notes, and snippets.

@asimzeeshan
asimzeeshan / proxmox.php
Created June 8, 2020 16:21
Get Proxmox VMs list
<?php
// Require the autoloader
require_once 'vendor/autoload.php';
// Use the library namespace
use ProxmoxVE\Proxmox;
// Create your credentials array
$credentials = [
@asimzeeshan
asimzeeshan / install.sh
Created April 28, 2020 10:46 — forked from mkubenka/install.sh
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt
@asimzeeshan
asimzeeshan / install_docker.sh
Last active April 11, 2024 07:27
Install docker & docker-compose on Debian 9 (stretch)
#!/bin/bash
############################################################
# Get the pre-requisite packages installed
############################################################
apt install -y htop iotop iftop
apt install -y curl apt-transport-https
# Install docker
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
@asimzeeshan
asimzeeshan / docker_show_all_ips.sh
Created October 12, 2018 05:37
To Show all ips and name in the new docker
docker ps -q | xargs -n 1 docker inspect --format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}} {{ .Name }}' | sed 's/ \// /'
@asimzeeshan
asimzeeshan / install_sublime3.sh
Created December 6, 2017 18:29
Install sublime3 for Debian/Ubuntu (2017)
#
# https://www.sublimetext.com/docs/3/linux_repositories.html
#
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt install apt-transport-https
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
sudo apt update && sudo apt install sublime-text
@asimzeeshan
asimzeeshan / cpanel_dnsonly_dns_zones.sh
Created November 26, 2017 22:58
cPanel DNSOnly count DNS zones
#!/bin/bash
############################################################
# Count Number of BIND Zone files
############################################################
cd /var/named
echo -n 'Total Zones: '
ls -lh *.db | wc -l
@asimzeeshan
asimzeeshan / cPanelDNSOnly_disable_networkmanager_centos7.sh
Last active December 19, 2018 07:09
Disable NetworkManager for CentOS 7 (for cPanel DNSOnly)
#!/bin/bash
# ==========================================================
# Instructions from https://documentation.cpanel.net/display/CKB/How+to+Disable+Network+Manager
# ==========================================================
systemctl stop NetworkManager.service
systemctl disable NetworkManager.service
echo "NM_CONTROLLED=no" > /etc/sysconfig/network-scripts/ifcfg-eth0
systemctl enable network.service
systemctl start network.service
yum remove NetworkManager
@asimzeeshan
asimzeeshan / Vagrant.bootstrap.sh
Created May 4, 2017 18:23 — forked from asmerkin/Vagrant.bootstrap.sh
A simple LAMP Vagrantfile and Bootstrap file for Vagrant and ubuntu/trusty64 box. It uses mpm-workers and php5-fpm + some extra tools like grunt, gulp and composer.
#!/usr/bin/env bash
# ---------------------------------------
# Virtual Machine Setup
# ---------------------------------------
# Adding multiverse sources.
cat > /etc/apt/sources.list.d/multiverse.list << EOF
deb http://archive.ubuntu.com/ubuntu trusty multiverse
deb http://archive.ubuntu.com/ubuntu trusty-updates multiverse
@asimzeeshan
asimzeeshan / purge.sh
Created March 10, 2017 03:09 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/sh
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@asimzeeshan
asimzeeshan / manage-etc-hosts.sh
Created February 26, 2017 11:57 — forked from irazasyed/manage-etc-hosts.sh
Bash Script to Manage /etc/hosts file for adding/removing hostnames.
#!/bin/sh
# PATH TO YOUR HOSTS FILE
ETC_HOSTS=/etc/hosts
# DEFAULT IP FOR HOSTNAME
IP="127.0.0.1"
# Hostname to add/remove.
HOSTNAME=$1