Skip to content

Instantly share code, notes, and snippets.

View chocolatine.ps1
$user = $env:USERNAME
$username = Get-ADUser $user -Properties GivenName | Select-Object -ExpandProperty GivenName
$usermail = Get-ADUser $user -Properties mail | Select-Object -ExpandProperty mail
$mailAddrList = "..."
$Outlook = New-Object -ComObject Outlook.Application
$Mail = $Outlook.CreateItem(0)
$Mail.To = $mailAddrList
$Mail.Subject = "Viennoiseries de fin des vacances "
$Mail.Body ="Bonjour à tous,
View sickrage.log
2015-08-21 12:13:22 ERROR POSTPROCESSER :: Exception generated in thread POSTPROCESSER: ascii : /var/medias/complete-downloads/X-Files.S09.(+bonus).FRENCH.DVDRip.Xvid.AC3/Bonus/Scènes coupées/X-Files.S09E15 N'abandonnez jamais.avi : error 83 : error 84 : ordinal not in range(128)
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: Looking up quality for name X-Files.S09E15 N'abandonnez jamais.avi, got Unknown
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: Looking up quality for name Scènes coupées, got Unknown
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: Setter sets location to /var/medias/series/The X-Files/Season 09/X-Files.S09E15-N'abandonnez jamais-FRENCH.DVDRip.Xvid.avi
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: 77398: Loading episode details from DB for episode The X-Files S09E15
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: 77398: An object for episode S09E15 didn't exist in the cache, trying to create it
2015-08-21 12:13:22 DEBUG POSTPROCESSER :: Retrieving episode object for 9x15
2015-08-21 12:13:
@hardware
hardware / smartdnotify.sh
Created Aug 16, 2015
Smartd notification
View smartdnotify.sh
#!/bin/sh
TMP_FILE=/tmp/smartd_report
echo "" > $TMP_FILE
# Arguments
echo "Command line argument 1:" >> $TMP_FILE
echo $1 >> $TMP_FILE
echo "Command line argument 2:" >> $TMP_FILE
View newrelic.js
// cron.js
// [...]
if( newRelicEvents.length > 0 )
newrelic.submitEvents( newRelicEvents, next );
res.send('PROCESSING REQUESTS COMPLETED !');
// [...]
View gist:d89aa95f422c0aac9645
-rw-rw-r-- 1 sickrage sickrage 43K Jul 25 13:12 The.Originals.S02E01.720p.HDTV.X264-DIMENSION.fr.srt
-rw-rw-rw- 1 debian-transmission debian-transmission 837M Jul 25 12:56 The.Originals.S02E01.720p.HDTV.X264-DIMENSION.mkv
-rw-rw-r-- 1 sickrage sickrage 52K Jul 25 13:13 The.Originals.S02E02.720p.HDTV.X264-DIMENSION.fr.srt
-rw-rw-rw- 1 debian-transmission debian-transmission 789M Jul 25 12:56 The.Originals.S02E02.720p.HDTV.X264-DIMENSION.mkv
-rw-rw-r-- 1 sickrage sickrage 50K Jul 25 13:14 The.Originals.S02E03.720p.HDTV.X264-DIMENSION.fr.srt
-rw-rw-rw- 1 debian-transmission debian-transmission 886M Jul 25 12:56 The.Originals.S02E03.720p.HDTV.X264-DIMENSION.mkv
-rw-rw-r-- 1 sickrage sickrage 43K Jul 25 13:13 The.Originals.S02E04.720p.HDTV.X264-DIMENSION.fr.srt
-rw-rw-rw- 1 debian-transmission debian-transmission 779M Jul 25 13:02 The.Originals.S02E04.720p.HDTV.X264-DIMENSION.mkv
-rw-rw-r-- 1 sickrage sickrage
View sickrage.log
2015-07-26 08:57:15 ERROR FINDSUBTITLES :: Traceback (most recent call last):
@hardware
hardware / prewikka.service
Created Jun 23, 2015
Prewikka.service file
View prewikka.service
[Unit]
Description=Prewikka
After=network.target
[Service]
Type=simple
ExecStart=/usr/bin/prewikka-httpd
Restart=always
TimeoutStopSec=10s
View gpg
# Importer une clé
gpg --import [filename]
# Rechercher une clé depuis serveur distant
gpg --keyserver pgp.mit.edu --search-keys KEYID
# Importer une clé depuis un serveur distant
gpg --keyserver pgp.mit.edu --recv-keys KEYID
# Exporter une clé sur un serveur distant
View script.sh
#!/bin/bash
# Récupération de l'adresse IP WAN
WANIP=$(dig +short myip.opendns.com @resolver1.opendns.com)
if [ "$IP" = "" ]; then
WANIP=$(wget -qO- ipv4.icanhazip.com)
fi
read -p "> Veuillez saisir le nom d'hôte : " HOSTNAME
@hardware
hardware / gist:5a2fa850411f700ba8b5
Created Mar 6, 2015
Search mail providers in db
View gist:5a2fa850411f700ba8b5
CREATE OR REPLACE FUNCTION CHARINDEX(text, text, integer) RETURNS integer AS $$
SELECT CASE WHEN strpos(substr($2, $3+1), $1) = 0 THEN 0
ELSE strpos(substr($2, $3+1), $1) + $3 END;
$$ LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT;
SELECT DISTINCT substring(mail,charindex('@',mail,1)+1,length(mail)) FROM table;