Skip to content

Instantly share code, notes, and snippets.

@phnahes
phnahes / convert.sh
Created November 1, 2023 18:00
# Audio and Video Encoding for Pionner AVH-P3180DVD to play movies from USB/CD
# Audio and Video Encoding for Pionner AVH-P3180DVD to play movies from USB/CD
ffmpeg -i source_video.mp4 \
-c:v mpeg4 \
-q:v 5 \
-tag:v DIVX \
-s 640x480 \
-c:a libmp3lame \
-q:a 5 \
-ac 2 \
@phnahes
phnahes / convert.sh
Last active October 27, 2023 16:33
Audio and Video Encoding for Pionner DVH-8580AVBT to play movies from USB
# Audio and Video Encoding for Pionner DVH-8580AVBT to play movies from USB
ffmpeg -i source_video.mp4 \
-c:v libxvid \
-b:v 192k \
-s 640x480 \
-ar 44100 \
-ac 2 \
-b:a 192k \
destination_video.avi
@phnahes
phnahes / logs.sql
Created January 27, 2023 18:57
Enable / Disable and Read MYSQL "general_log"
-- To Enable Query logging on the database
set global general_log = 1;
set global log_output = 'table'
-- For turn Hex readable:
select a.*, convert(a.argument using utf8) from mysql.general_log a;
-- To Disable Query logging on the database
set global general_log = 0;
@phnahes
phnahes / global-protect.sh
Last active December 2, 2021 12:44
Control GlobalProtection in MacOs
#!/bin/bash
#https://www.robertsetiadi.com/disabling-globalprotect-vpn-auto-run-during-mac-start-up/
case $# in
0)
echo "Usage: $0 {start|stop}"
exit 1
;;
1)
@phnahes
phnahes / button.ino
Created July 18, 2021 14:25
ESP32 button with debounce and no repeat pressed while hold button
volatile unsigned long DebounceTimer;
volatile int ButtonPressed;
volatile unsigned int delayTime = 200;
volatile unsigned int delayRepeatTime = 500;
volatile byte state = LOW;
unsigned long lastInterrupt;
#define pin 34
#define ledPin 2
@phnahes
phnahes / pv.md
Created October 22, 2020 19:22
Remove Stucks PV/PVC from Kubernets

To remove Stucks PV/PVC from Kubernets

kubectl get pv | tail -n+2 | awk '{print $1}' | xargs -I{} kubectl patch pv {} --type='merge' -p '{"metadata":{"finalizers": null}}'
@phnahes
phnahes / din_stages.groovy
Last active October 2, 2020 21:09
Jenkinsfile - Dinamic stages
#!/usr/bin/env groovy
def list
pipeline {
agent none
stages {
stage('Create List') {
agent any
steps {
script {
@phnahes
phnahes / gist:8e8b8132e6693344b5cf383c9b8467df
Created August 28, 2020 15:36
Decrypt Jenkins credential.xml
println(hudson.util.Secret.decrypt("{...}"))
@phnahes
phnahes / settings.json
Created July 17, 2020 20:15
Windows Terminal Settings
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{07b52e3e-de2c-5db4-bd2d-ba144ed6c273}",
"copyOnSelect": true,
"copyFormatting": false,
"profiles":
{
"defaults":
{
@phnahes
phnahes / wsl.conf
Created July 17, 2020 20:14
Windows Subsystem Linux - /etc/wsl.conf
[automount]
enabled = true
root = /
options = "metadata,umask=22,fmask=11,uid=1000,gid=1000"
mountFsTab = false
[network]
generateHosts = true
generateResolvConf = true