# Before that, you must expand disk in vSphere
# /dev/sda - disk to expand
fdisk /dev/sda
n
p
[enter]
[enter]
[enter]
w
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
# pip install pyobjc | |
from AppKit import NSDate, NSDistributedNotificationCenter, NSObject, NSRunLoop | |
logging.basicConfig( | |
level=logging.INFO, | |
format="[%(asctime)s] %(levelname)s [%(funcName)s:%(lineno)d] %(message)s" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json | |
import logging | |
import logging.handlers | |
import os | |
import signal | |
import sys | |
import dbus | |
import dbus.mainloop.glib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ "$EUID" -ne 0 ]; then | |
echo "You need to run this script as root" | |
exit 1 | |
fi | |
if [ "$(systemd-detect-virt)" == "openvz" ]; then | |
echo "OpenVZ is not supported" | |
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export CLIENT_NUMBER='3' | |
export CLIENT_CONFIG_FILE="wg0-client$CLIENT_NUMBER.conf" | |
export CLIENT_PRIV_KEY="$(wg genkey)" | |
export CLIENT_PUB_KEY="$(echo $CLIENT_PRIV_KEY | wg pubkey)" | |
export CLIENT_WG_IPV4="10.66.66.$CLIENT_NUMBER" | |
export CLIENT_WG_IPV6="fd42:42:42::$CLIENT_NUMBER" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from datetime import datetime, timedelta | |
import graphviz | |
def generate_sample_data(): | |
clients = [i for i in range(100)] | |
events = [f'page{i}' for i in range(20)] | |
now = datetime.now() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# source: https://gist.github.com/dreness/2de62e01d2053f9440eb | |
# Set repo's user.email to a default or alternate value based on remote domain. | |
# Because the in-flight commit info has already been set, if an email address | |
# change is needed, this commit is aborted. Retry the commit to use the new address. | |
# | |
# To automatically install custom hooks to new repos: | |
# 1) Add something like the following to ~/.gitconfig: | |
# [init] | |
# templatedir = ~/.git/templates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MacOS EnhancedDiscord installer with plugins and config for 1080p 60fps streams | |
# DISCLAIMER! | |
# Using EnhancedDiscord, or any other client mod, is against Discord's Terms of Service. | |
# Use it at your own risk. It's very unlikely any action will be taken against you, | |
# but we take no responsibility if anything happens. | |
# Usage: | |
# copy script into folder where you want store your EnhancedDiscord and plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import xlsxwriter | |
import json | |
start_date = "2000-03-01" | |
end_date = "2019-03-02" | |
link = f"https://iss.moex.com/iss/history/engines/stock/markets/shares/boardgroups/57/securities/SBER.jsonp?lang=ru&from=2000-03-01&till=2019-03-02&iss.json=extended&iss.meta=off&sort_order=TRADEDATE&sort_order_desc=desc&start=" | |
resp = requests.get(link + "0") |
NewerOlder