Skip to content

Instantly share code, notes, and snippets.

View z3nth10n's full-sized avatar
🏠
Working from home

Álvaro Rodríguez z3nth10n

🏠
Working from home
View GitHub Profile
@z3nth10n
z3nth10n / join_sql.py
Last active August 22, 2022 13:09
Divides files into chunks of 1000 VALUES for INSERT INTO and then divide it into chunks of 100k lines
import glob
from math import floor
def rreplace(s, old, new, count):
return (s[::-1].replace(old[::-1], new[::-1], count))[::-1]
i = 0
j=0
files = glob.glob("./*.sql")
@z3nth10n
z3nth10n / run.py
Last active August 17, 2022 09:20
Centro de Descarga GNIG
import requests
from bs4 import BeautifulSoup
import aiofiles
import aiohttp
from progress.bar import Bar
import time
# from syncer import sync
import asyncio
async def async_http_download(descargas, chunk_size=65536):
@z3nth10n
z3nth10n / README.md
Last active January 29, 2020 21:44
Backup html and databases
@z3nth10n
z3nth10n / make_result.log
Created January 22, 2020 17:30
PHT COMPILING ON PHP 7.4
/bin/bash /root/pht/libtool --mode=compile cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/pht -DPHP_ATOM_INC -I/root/pht/include -I/root/pht/main -I/root/pht -I/etc/php7/include/php -I/etc/php7/include/php/main -I/etc/php7/include/php/TSRM -I/etc/php7/include/php/Zend -I/etc/php7/include/php/ext -I/etc/php7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -std=gnu99 -c /root/pht/src/pht_copy.c -o src/pht_copy.lo
cc -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -I. -I/root/pht -DPHP_ATOM_INC -I/root/pht/include -I/root/pht/main -I/root/pht -I/etc/php7/include/php -I/etc/php7/include/php/main -I/etc/php7/include/php/TSRM -I/etc/php7/include/php/Zend -I/etc/php7/include/php/ext -I/etc/php7/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -std=gnu99 -c /root/pht/src/pht_copy.c -fPIC -DPIC -o src/.libs/pht_copy.o
/root/pht/src/pht_copy.c: In function ‘copy_static_variables’:
/root/pht/src/pht_copy.c:272:22: error: ‘IS_CONSTANT’ undeclared (first use in this function)
case IS_CONSTANT:
@z3nth10n
z3nth10n / a_dynamic_ip_from_namedotcom.md
Last active February 17, 2022 18:28
Updates your dynamic IP using name.com services

Name.com IP updater

Updates your dynamic IP using name.com services

This is useful when your have a local server in home.

Setup (3 steps)

Linq.py uses Python 2.7+ be careful!

@z3nth10n
z3nth10n / tutorial.md
Last active September 13, 2019 02:09
How to create packages for Unity3D with Github

In this tutorial I will show how to create packages for Unity using orphan branches in Github.

The idea is simple, just clone your project (you will need to work with a copy in case you don't want to checkout (switch) branches too many times):

$ git clone <url>

Then create a new orphan branch:

$ git checkout --orphan unity-<ver>

@z3nth10n
z3nth10n / terraria-server-part1.sh
Last active August 20, 2019 18:11
Terraria Server config for Linux
#!/bin/bash
wget https://github.com/tModLoader/tModLoader/releases/download/v0.10.1.5/tModLoader.Linux.v0.10.1.5.zip
wget http://terraria.org/server/terraria-server-1352.zip
mkdir terraria-mods
mkdir terraria-server
mkdir 1352
apt-get install unzip
unzip terraria-server-1352.zip -d 1352
cp -r 1352/Linux/* terraria-server/
auto vmbr1
iface vmbr1 inet static
address 192.168.xx.xx
netmask 24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.xx.0/24' -o vmbr0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.xx.0/24' -o vmbr0 -j MASQUERADE
wget "https://tinyurl.com/proxmox-conf-v2" -O conf-v2.sh && bash conf-v2.sh "example.local"
url="https://proxmox-resolv.herokuapp.com/?action="
name=$(date +%S%N)
echo "Choose:"
echo "1) Download Gitlab"
echo "2) Download Debian VM"
echo "3) Salir"
read -p "==> " a
case $a in
1) part="download-gitlab"