View hide_container_volumes_in_user-places.xbel.js
#!/usr/bin/env node | |
/*jshint node: true, esversion: 10 */ | |
/** | |
* Hide container filesystems in ~/.local/share/user-places.xbel | |
* | |
* @url https://gist.github.com/duzun/e583e1634ed6f6765dbaba0ac846e5cc | |
* @author Dumitru Uzun | |
* @version 0.0.1 | |
*/ |
View mysqli__multi_query.php
if ($mysqli->multi_query("START TRANSACTION;$query--\nCOMMIT;")) { | |
$idx = 0; | |
$ret = 0; | |
if($output = $mysqli->error) { | |
echo $output, PHP_EOL; | |
die(-4); | |
} | |
else { | |
do { |
View undetect-console.js
console.log = | |
console.clear = | |
console.profile = | |
console.profileEnd = | |
eval = function(){}; |
View casign
#!/usr/bin/env bash | |
## | |
# Sign a certificate using my root_ca. | |
# | |
# Note: duzun_root_ca.crt must be in the trusted root ca (see https://www.archlinux.org/news/ca-certificates-update/) | |
# | |
# @author Dumitru Uzun (DUzun.Me) | |
# @version 1.1.0 | |
## |
View shiftsrt.js
#!/bin/node | |
/*jshint esversion: 9*/ | |
/** | |
* Time-shift video subtitles in a .srt file. | |
* | |
* Usage: | |
* shiftsrt.js seconds input_file|- [output_file|-] | |
* | |
* Examples: |
View downlist
#!/bin/bash | |
# Download a file listed in a list file | |
# @author Dumitru Uzun (DUzun.Me) | |
# @version 1.0.1 | |
_me_="$(basename "$0")" | |
_start_time_=$(date +%s) | |
referer= | |
_cat_= |
View php_sess_to_redis.sh
#!/bin/bash | |
export REDISCLI_AUTH=my-supper-strong-password-4-redis-server | |
TTL=$(( 24 * 3600 )) | |
# cd "/var/sess" | |
for i in sess_*; do | |
ex=$(( $(date +%s) - $(stat -c %Y "$i") + $TTL )) |
View fix_lib_links.sh
#!/bin/bash | |
fix_lib_links() { | |
local i j dir write | |
[ "$2" = "-w" ] && write="$2" | |
dir=${1:-$PWD} | |
( | |
cd "$dir" && \ | |
for i in *.so.*; do | |
if [ -f "$i" ]; then |
View cron_eye_safe.sh
#!/bin/sh | |
# | |
# Keep your eyes safe on cron | |
# | |
# @author Dumitru Uzun (DUzun.Me) | |
# @web https://gist.github.com/duzun/99bd0d1cba6c8ad1b5bf321c2689a257 | |
# | |
_user=${USER:-$(whoami)} |
View findByKey.php
<?php | |
// Note: | |
// Whether $list contains a NULL value for $needle at some level, or there is no $needle at all, | |
// in both cases this function returns NULL. | |
// If you want to find non-NULL $needle only, replace `array_key_exists` with `isset` | |
function findByKey($list, $needle) { | |
$stack = [$list]; | |
while( !empty($stack) ) { |
NewerOlder