Skip to content

Instantly share code, notes, and snippets.

View Eddy-Barraud's full-sized avatar

Eddy Barraud Eddy-Barraud

View GitHub Profile
#Edit /etc/locale.gen
nano /etc/locale.gen
#Uncomment en_US.UTF-8 UTF-8
#DO
locale-gen
@Eddy-Barraud
Eddy-Barraud / License.txt
Last active May 8, 2022 18:44
This Script allow reset the Windows Update Agent resolving issues with Windows Update. Comes from https://gallery.technet.microsoft.com/scriptcenter/Reset-Windows-Update-Agent-d824badc
MIT License
Copyright (c) 2018 Manuel Gil
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@Eddy-Barraud
Eddy-Barraud / Windows_Update_reboot.cmd
Last active May 8, 2022 18:44
Just reboot services linked to windows update
@echo off
echo Reminder: This must be run from an elevated command prompt!
pause
net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
@Eddy-Barraud
Eddy-Barraud / ffmpeg commands.md
Last active September 19, 2023 07:53
ffmpeg commands reminder

Print videos informations and streams

For all informations : ffmpeg -i input.mkv

For informations on streams : ffprobe -v error -show_entries stream=index,codec_name,codec_type input.mkv

[STREAM]
index=0
codec_name=h264
@Eddy-Barraud
Eddy-Barraud / Renaming_files_to_sequential_numbers.md
Last active June 16, 2018 23:47
Renaming files in a folder to sequential numbers

Here are multiple ways to rename files inside a folder to a sequential numbers

1- In one line :

ls | cat -n | while read n f; do mv "$f" "$n.extension"; done

you can also use ls -uT to sort files by creation date

2- With the 'rename' command

Using imegemagick

apt-get install imagemagick

  • Convert single file

    convert ubuntuhandbook.png ubuntuhandbook.jpg

  • Convert all files

Search for a word inside every files in current folder and replace it with sed

One line

find . -type f -print0 -exec sed -i 's/hello/hi/g' {} +

(we can add -name "*.txt" option to restrict the recursion and speed up the work)

Just for searching

grep -R {something_to_look_for} {where_to_look_in}

ssh -L port-local:HOSTNAME:port-distant machine-distante

exemple, on veut rediriger le port 32400 (plex) de notre serveur headless vers le port 80 de notre ordinateur

ssh -L 80:127.0.0.1:32400 vps.example.com -N

-N : execute seulement le forward, ne lance pas de terminal distant

-R : inverse le sens (à la place de -L); on parle de remote port forwarding

@Eddy-Barraud
Eddy-Barraud / Rclone-Fuse.md
Created August 26, 2018 15:32
Mount cloud disk (OneDrive,etc...) In Linux Using Rclone (&fuse)

Thanks to Rclone you can mount any kind of cloud disk !

Begin by installing rclone

curl https://rclone.org/install.sh | sudo bash

Add a new remote to Rclone

rclone config ...

detailed instructions HERE : https://rclone.org/docs/

<?php
$characters = ["a", "b", "c", "d", "e", "f", "g", "h",
"i", "j", "k", "l", "m", "n", "o", "p",
"q", "r", "s", "t", "u", "v", "w", "x",
"y", "z", "A", "B", "C", "D", "E", "F",
"G", "H", "I", "J", "K", "L", "M", "N",
"O", "P", "Q", "R", "S", "T", "U", "V",
"W", "X", "Y", "Z", "1", "2", "3", "4",
"5", "6", "7", "8", "9", "0"];