Skip to content

Instantly share code, notes, and snippets.

View sonuame's full-sized avatar
😀
Life z good

Sunil sonuame

😀
Life z good
View GitHub Profile
@sonuame
sonuame / MountVHD.cmd
Created March 19, 2018 09:27 — forked from nicjansma/MountVHD.cmd
MountVHD and UnMountVHD: Allows you to mount .VHDs in Windows 7 from the command-line. http://nicj.net/2012/01/04/mounting-vhds-in-windows-7-from-a-command-line-script
@echo off
setlocal enabledelayedexpansion
if {%1}=={} (
echo Usage: %~nx0 [vhd] [letter]
exit /b 1
)
set vhdPath=%~dpnx1
set driveLetter=%2
@sonuame
sonuame / install-redis-wsl.sh
Last active October 4, 2020 08:15 — forked from clzola/install-redis.sh
Bash script for installing Redis on Ubuntu 18.04
#!/bin/bash -e
# cleanup old installation
rm -rf /etc/redis
rm -rf /var/lib/redis
rm $HOME/redis.sh
deluser --force --remove-home redis
# Install the Build and Test Dependencies
apt-get update
#!/bin/bash -e
# Use the following variables to control your install:
# Password for the SA user (required)
MSSQL_SA_PASSWORD='P@ssw0rd'
# Product ID of the version of SQL server you're installing
# Must be evaluation, developer, express, web, standard, enterprise, or your 25 digit product key
# Defaults to developer
#!/bin/sh -e
#
# pptpd installation script on my own CentOS 7 box.
# inspired by: https://www.digitalocean.com/community/questions/how-to-install-pptp-vpn-on-centos-7
# and http://unix.stackexchange.com/questions/150837/redhat-centos-7-firewalld-best-practice-for-pptp-or-l2tp-ipsec-rules
#
# Author: 2015 Steve Yang <[email protected]>
# The script comes with ABSOLUTELY NO WARRANTY.
git config --global credential.helper store
git pull
sudo apt-get install iptables-persistent
sudo iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 22 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 80 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 443 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 1433 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 9000 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo swapon --show
free -h
df -h
sudo fallocate -l 5G /swapfile
ls -lh /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
use admin
db.createUser({ user :"sonuame", pwd :"xxx", roles :["root"]});
db.changePassword("sonuame", "xxxxxxx")
sudo nano /etc/apt/sources.list
add
deb http://download.webmin.com/download/repository sarge contrib
sudo apt update
wget -q -O- http://www.webmin.com/jcameron-key.asc | sudo apt-key add
sudo apt update
sudo apt install webmin
sudo ufw allow 10000
@sonuame
sonuame / ignore-ssl.ps1
Created October 7, 2020 18:52
powershell ignore ssl
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}
}