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 | |
# /!\ keep space character at begening of command to avoid saving it in history | |
# real mysql DROP TABLE in one command -- very fast | |
mysqldump --add-drop-table --no-data -u[USERNAME] -p[PASSWORD] [DATABASE]| grep -e '^DROP \| FOREIGN_KEY_CHECKS'| mysql -u[USERNAME] -p[PASSWORD] [DATABASE] | |
# OR | |
# loop x time on DROP TABLE, but no mysqldump -- https://stackoverflow.com/a/38814457/293214 |
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
<?php | |
/** | |
* @param string $string | |
* @param string $start | |
* @param string $end | |
* | |
* @return bool|string | |
* @see https://stackoverflow.com/questions/5696412/how-to-get-a-substring-between-two-strings-in-php | |
* | |
*/ |
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
// Script for https://www.crowdfarming.com/ | |
document.querySelectorAll(".project-card-container").forEach(function (element) { | |
var priceRaw = element.querySelector(".ds-oh-card-footer-price-quantity").textContent; | |
var price = priceRaw.replace(",", ".").match(/[+-]?\d+(\.\d+)?/g)[0]; | |
var quantity = ""; | |
if (element.querySelector(".ds-adoption-card-footer-price-weight") !== null) { | |
quantity = element.querySelector(".ds-adoption-card-footer-price-weight").textContent; | |
} else if (element.querySelector(".ds-select-box-selected-option span") !== null) { | |
quantity = element.querySelector(".ds-select-box-selected-option").textContent; |
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 | |
# Memo to found it quicker in future... | |
# | |
# Q: How to delete a column/columns of a CSV file which has cell values with a string enclosed in " , "? | |
# https://www.unix.com/302824377-post1.html | |
# | |
# A: https://www.unix.com/302825517-post6.html | |
# Dataset in: en_EN-export-sample.csv |
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 | |
#alias bato_reboot="ssh root@batocera.local -t 'reboot'" | |
ssh root@batocera.local -t 'reboot' | |
#alias bato_fix_perms="sudo chown -R root:root . && sudo find . -type f -exec chmod -c 644 {} \; && sudo find . -type d -exec chmod -c 755 {} \;" | |
# to run from SHARE/roms folder | |
sudo chown -R root:root . && sudo find . -type f -exec chmod -c 644 {} \; && sudo find . -type d -exec chmod -c 755 {} \; |
ffmpeg -i VID_20210627_164901.mp4 -c:a copy -c:v libx265 -vtag hvc1 VID_20210627_164901_x265.mp4
for bulk check here
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
# xxxxxxxx is the salt - it can change or stay like that | |
# admin123 is the password, you must change it | |
UPDATE admin_user SET `password` = CONCAT(SHA2('xxxxxxxxadmin123', 256), ':xxxxxxxx:1') WHERE `username` = 'admin'; |
NewerOlder