Skip to content

Instantly share code, notes, and snippets.

View s12321's full-sized avatar

s12321

View GitHub Profile
@s12321
s12321 / Office_kms
Created October 11, 2024 10:46 — forked from OkoyaUsman/Office_kms
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@s12321
s12321 / windows_and_office_kms_setup.adoc
Last active October 11, 2024 10:43 — forked from jerodg/windows_and_office_kms_setup.adoc
Activate Windows and Office Using KMS Server

Microsoft Windows and Office KMS Setup

@s12321
s12321 / db-connect-test.php
Created December 16, 2021 09:44 — forked from M165437/db-connect-test.php
Script for a quick PHP MySQL DB connection test.
<?php
# Fill our vars and run on cli
# $ php -f db-connect-test.php
$dbname = 'name';
$dbuser = 'user';
$dbpass = 'pass';
$dbhost = 'host';
$link = mysqli_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'");
@s12321
s12321 / SpeedTest.Net Server List
Created December 11, 2021 07:10 — forked from gxgani/SpeedTest.Net Server List
Speedtest.net Server List
<?xml version="1.0" encoding="UTF-8"?>
<settings>
<servers><server url="http://speedtest.pronea.no/speedtest/upload.php" lat="69.6828" lon="18.9428" name="Tromso" country="Norway" countrycode="NO" sponsor="Pronea AS" sponsorurl="http://www.pronea.no/" id="1327" gid="0" url2="http://speedtest.pronea.no/speedtest/upload.php" bigsamples="1" />
<server url="http://speedtest.mmsn.ru/speedtest/upload.php" lat="68.9667" lon="33.0833" name="Murmansk" country="Russian Federation" countrycode="RU" sponsor="JSC M2C" sponsorurl="http://www.mmsn.ru" id="1521" gid="0" url2="http://speedtest.mmsn.ru/speedtest/upload.php" bigsamples="1" />
<server url="http://st1.teletoria.ru/speedtest/upload.php" lat="68.9667" lon="33.0833" name="Murmansk" country="Russian Federation" countrycode="RU" sponsor="ISP Teletoria" sponsorurl="http://www.teletoria.ru" id="2342" gid="0" url2="http://st1.teletoria.ru/speedtest/upload.php" bigsamples="1" />
<server url="http://speedtest.oltv.ru/speedtest/upload.php" lat="68.1500" lon="33.2833" nam
@s12321
s12321 / cdm_fio.sh
Created October 14, 2021 08:33 — forked from i3v/cdm_fio.sh
Reproducing CrystalDiskMark tests with fio - fixes for https://unix.stackexchange.com/revisions/480191/9
#!/bin/bash
# This script is based on https://unix.stackexchange.com/revisions/480191/9 .
# The following changes proved to be necessary to make it work on CentOS 7:
# * removed disk info (model, size) - not very useful, might not work in many cases.
# * using "bw" instead of "bw_bytes" to support fio version 3.1 (those availible through yum @base)
# * escaping exclamation mark in sed command
# * the ".fiomark.txt" is not auto-removed
LOOPS=5 #How many times to run each test
@s12321
s12321 / website-checker.sh
Created April 9, 2021 23:22 — forked from dominic-p/website-checker.sh
This is a shell script to check a provided list of URLs to see if the websites are working or not. It was based on the answers provided to this question: http://stackoverflow.com/q/21391776/931860
#!/bin/sh
# ---- website-checker.sh ----
# Pings a list of websites using cURL to see if they are up and
# there are no errors. If there are problems, we send an email using mailx
# to let ourselves know about the problem.
################################################################################
# Recipient of the errors email
admin_email=youremail@host.com
@s12321
s12321 / ngnix.config
Created February 7, 2021 02:02 — forked from lukecav/ngnix.config
Browser caching rules for NGNIX and expire headers.
# Browser caching of static assets.
location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf)$ {
expires 7d;
add_header Cache-Control "public, no-transform";
}
# Media: images, icons, video, audio send expires headers
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm)$ {
expires 1M;
access_log off;
@s12321
s12321 / setup-certbot-script.sh
Created January 16, 2021 21:38 — forked from stevenvandervalk/setup-certbot-script.sh
A bash script to install certbot and add crontab to renew the cert
#!/bin/bash
#
# This sets up Let's Encrypt SSL certificates and automatic renewal
# using certbot: https://certbot.eff.org
#
# - Run this script as root.
# - A webserver must be up and running.
#
# Certificate files are placed into subdirectories under
# /etc/letsencrypt/live/*.
@s12321
s12321 / genCert.md
Created January 12, 2021 21:17 — forked from sturadnidge/genCert.md
Generate a self signed certificate in 1 line + a config file

To generate a self-signed cert, do the following:

openssl req -config 12factor.req -new -nodes -x509 -newkey rsa:2048 -sha256 -keyout 12factor.key -out 12factor.cert -days 3650

Where 12factor.req is:

[ req ]
default_bits        = 2048
default_keyfile     = 12factor.key
@s12321
s12321 / gist:acc99caf8c2fbe71adfd016eebe211fd
Last active January 7, 2021 00:20 — forked from jessuppi/gist:ab5517aa50b3bc83ac37abb8267e005b
Debconf prepare MySQL root password (variations)
## prepare root password for apt (PSA: sudo the shit out of these or it will fail) ##
#####sudo echo "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}" | sudo debconf-set-selections
#####sudo echo "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}" | sudo debconf-set-selections
#####sudo echo "mysql-community-server mysql-server/default-auth-override select Use Legacy Authentication Method (Retain MySQL 5.x Compatibility)" | sudo debconf-set-selections
# echo "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}" | debconf-set-selections
# echo "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}" | debconf-set-selections
# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/root-pass password ${DB_PASSWORD_ROOT}"
# sudo debconf-set-selections <<< "mysql-community-server mysql-community-server/re-root-pass password ${DB_PASSWORD_ROOT}"
# sudo