Skip to content

Instantly share code, notes, and snippets.

View montali's full-sized avatar
HUSTLING

Simone Montali montali

HUSTLING
View GitHub Profile
@montali
montali / apnscp.md
Last active February 28, 2021 11:23
Things to do after installing WP on APNSCP

Things to do after installing WordPress on APNSCP

This is more of a reminder to myself.

  • Change the fs_method to direct in the wp-config.php
  • Enable the Apache jail on the Nexus
  • Add php_value[max_input_vars] = 10000 to /home/virtual/[SITENAME]/etc/php-fpm.d/sites in a file ending with .conf
    • Having done that, restart PHP-FPM through Web -> PHP Pools
    • If that didn't work, edit the other conf file
  • Generate the SSL certificate via Let's Encrypt
  • Purge the cache found in Site Optimizer on the green button
@montali
montali / translate.py
Created June 16, 2020 15:26
Dataframe translation using googletrans
import pandas as pd
import numpy as np
from googletrans import Translator
translator = Translator()
data = pd.read_csv("overview-of-recordings.csv")
translated_data = pd.DataFrame(columns=["phrase", "prompt"])
i=0
total = data.shape[0]
for index, row in data.iterrows():
phrase = translator.translate(row["phrase"], dest="it").text
@montali
montali / things.md
Last active June 20, 2020 09:00
Useful bash shit I will need someday

get a telegram chat id

curl https://api.telegram.org/bot$TELEGRAM_TOKEN/getUpdates | jq

format a USB key after making it bootable

diskutil list
diskutil eraseDisk free EMPTY /dev/disk??
@montali
montali / mycroft.json
Created April 19, 2020 08:01
Mycroft configuration
{
"lang": "it-it",
"max_allowed_core_version": 20.2,
"stt": {
"module": "mycroft",
"mycroft": {
"lang": "it-it"
}
},
"tts": {
@montali
montali / med_record1.json
Created April 10, 2020 20:20
Medical records generated by hospital-triage-skill
{
"can_talk": "yes",
"main_symptom": "fracture",
"limb": "braccio",
"code": "yellow",
"symptom_declaration": "sono caduto dalle scale e mi fa male un braccio",
"age": 21,
"other_symptoms": null,
"pain_index": "8",
"full_name": "simone montali"
@montali
montali / deepspeech-training.ipynb
Created April 6, 2020 09:00
DeepSpeech-training.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@montali
montali / parmaDomicilio.json
Last active April 5, 2020 12:19
Data for parmaDomicilio
{
"Agriturismi": {
"icon": "🏠",
"data": [{ "name": "Agriturismo Santa Felicita", "tel": "0521 494950" }]
},
"Bar/Pub/Birrerie": {
"icon": "🍻",
"data": [
{ "name": "Alfa Caf\u00e8", "tel": "335 5239809" },
{
@montali
montali / NFC.md
Created October 26, 2019 16:32
libnfc on MacOS usage

Using libnfc on MacOS requires disabling the ifdreader service:

sudo launchctl remove com.apple.ifdreader
sudo launchctl stop com.apple.ifdreader
@montali
montali / resizer.md
Created October 22, 2019 09:45
MacOS batch jpg resizing

Just use this in the right folder. It will resize to a max width of 1700, with a compression of 65%.

find . -name '*.jpg' -print0 | xargs -0 -L 1 sips --resampleHeightWidthMax 1700 --setProperty formatOptions 65
@montali
montali / MySQL docker utils.md
Last active October 18, 2019 08:56
Docker MySQL dumper

DUMP DB

docker exec [CONTAINER] sh -c 'exec mysqldump --all-databases -uroot -p"root"' > ~/dump.sql

ACCESS MYSQL CONSOLE

$ docker exec -it [CONTAINER] bash -l
# mysql -u root -p