Skip to content

Instantly share code, notes, and snippets.

View click0's full-sized avatar

Vladyslav V. Prodan click0

View GitHub Profile
@Envek
Envek / dnsmaster-update.sh
Last active August 12, 2017 23:55
Updates A and/or AAAA DNS records in DNS Master provider of Dynamic DNS. Works on Linux and OS X.
#!/bin/sh
usage() {
echo "DNS Master DynDNS update script. Updates A and/or AAAA records with public IPs that you have on your interfaces."
echo "Usage: $0 -h hostname[,hostname…] -u username -p password"
}
if [ $# -eq 0 ]; then usage; exit 1; fi
USERNAME=""
@andreykin
andreykin / backup.php
Last active August 8, 2018 03:01 — forked from menzerath/backup.php
PHP: Recursively Backup Files & Folders to ZIP-File
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* MIT-License - Copyright (c) 2012-2017 Marvin Menzerath
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');
@andreykin
andreykin / allow_mysql.sh
Created November 9, 2016 14:37
Allow mysql external connection for IP of current ssh-session (if dynamic ip)
ssh_client_ip=`echo $SSH_CLIENT | awk '{ print $1}'`;
ipfw -q add 00431 allow tcp from $ssh_client_ip to me 3306 in via em0 keep-state
#!/usr/bin/env python
#
# Calculates the total number of Science Packs needed for research
# in the game Factorio (www.factorio.com).
#
# Created by Gandalfx
# https://gandalfx.github.com
sciences = {
@zentavr
zentavr / proxmoxlib.js.diff
Created July 25, 2018 20:58
Proxmox 5.2 Subscription banner remove
--- /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js.bak 2018-05-14 12:06:33.000000000 +0300
+++ /usr/share/javascript/proxmox-widget-toolkit/proxmoxlib.js 2018-07-25 23:55:45.513350604 +0300
@@ -350,6 +350,8 @@ Ext.define('Proxmox.Utils', { utilities:
var data = response.result.data;
if (data.status !== 'Active') {
+
+ /*************************************************
Ext.Msg.show({
title: gettext('No valid subscription'),
@nl5887
nl5887 / transfer.fish
Last active March 22, 2022 09:07
Bash and zsh alias for transfer.sh. Transfers files and directories to transfer.sh.
function transfer
if test (count $argv) -eq 0
echo "No arguments specified. Usage:\necho transfer /tmp/test.md\ncat /tmp/test.md | transfer test.md"
return 1
end
## get temporarily filename, output is written to this file show progress can be showed
set tmpfile ( mktemp -t transferXXX )
## upload stdin or file
@skreuzer
skreuzer / connect.c
Created December 24, 2011 17:33
Make socket connection using SOCKS4/5 and HTTP tunnel
/***********************************************************************
* connect.c -- Make socket connection using SOCKS4/5 and HTTP tunnel.
*
* Copyright (c) 2000-2004 Shun-ichi Goto
* Copyright (c) 2002, J. Grant (English Corrections)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
@sarim
sarim / repairsqlite.sh
Created September 6, 2013 08:14
Sqlite db repair script
#!/bin/bash
DBSTATUS=$(sqlite3 "$1" "PRAGMA integrity_check")
if [ "$DBSTATUS" == "ok" ] ; then
echo DB ALREADY OK
else
echo FIXING CORRUPT DB
TMPDB=$(mktemp -t sarim)
echo ".mode insert
.dump" | sqlite3 "$1" > $TMPDB
#!/bin/sh -eu
sudo kldload filemon || /usr/bin/true
# echo 'WITH_CCACHE_BUILD=yes' > /etc/src.conf
echo 'WITH_META_MODE=yes' > /etc/src-env.conf
# echo 'WITH_DIRDEPS_BUILD=yes' >> /etc/src-env.conf
# umask 0022
cd /usr/src
NOW=$(date -u +%Y%m%d-%H%M)
NCPU=$(sysctl -n hw.ncpu)
#!/bin/bash
# iPXE build depends
apt-get install -y liblzma-dev git build-essential
# clone iPXE
[ ! -d ./ipxe ] && git clone http://git.ipxe.org/ipxe.git
cd ipxe/src
make clean
sed -i 's/#undef\tDOWNLOAD_PROTO_HTTPS/#define\tDOWNLOAD_PROTO_HTTPS/' config/general.h