This script was made for personal purposes, but it can still be useful to many. You NEED to change variables inside the script, like the SSH public key.
On a new Ubuntu server, run the following command:
#!/bin/bash | |
cd /sdcard/Android/media/com.whatsapp/WhatsApp/Media | |
while read path; do f=$(basename "$path"); touch -d "${f:4:4}-${f:8:2}-${f:10:2}T12:00:00z" "${path}"; done < <(find . -regextype posix-extended -regex ".*/[[:alpha:]]{3}-[[:digit:]]{8}-.*") |
''' | |
Based on https://math.stackexchange.com/a/1080170 | |
''' | |
from functools import lru_cache, reduce | |
import operator | |
@lru_cache() | |
def fact(n): | |
assert n >= 0 |
#!/bin/env python3 | |
''' | |
Super simple script to set chmod 644 to every file and 755 to every directory. | |
Useful, for instance, when moving files (in WSL) from the Windows Host to the Linux machine. | |
As we know, files in /mnt/c/ have the eXecute permission flagged, which is not desiderable. | |
''' | |
import os, sys |
#!/bin/bash | |
# | |
# RESTORE COMMANDS | |
# | |
# Database: | |
# cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
# | |
# Files: | |
# JOIN parts with cat filename.tar.gz.* > filename.tar.gz |
#!/bin/bash | |
set -e | |
# | |
# Whitelist config file. | |
# | |
# Make sure | |
# include /etc/nginx/conf.d/*.conf; | |
# is present inside the http {} block of |
package main | |
import ( | |
"fmt" | |
"strings" | |
) | |
func main() { | |
// ! Edit grammar | |
cfg := NewGrammar('S', map[byte]Rule{ |
block Client | |
parameter Real T = 1; // O meno! | |
// Variabili lato lettura (server -> client) | |
OutputBoolean readsignal; | |
InputInteger readfifodata[1]; | |
InputBoolean datavailable; | |
// Variabili lato scrittura (client -> server) | |
OutputInteger writefifodata[2]; // M = 2 |
X XaZ|YWc|W | |
Y Yd|WbZ|ZWc|X | |
W WXa|ZZd|YYe|c | |
Z XX|Zc | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <time.h> | |
#include <unistd.h> | |
#include <sys/stat.h> | |
#include <sys/types.h> | |
#define NUMBER_BYTES_TO_FLIP 10 | |
//#define FLIP_PROBABILITY 0.0001 |