Skip to content

Instantly share code, notes, and snippets.

View mo3rfan's full-sized avatar
🦆
irf@duck.com

Irfan mo3rfan

🦆
irf@duck.com
View GitHub Profile
@mo3rfan
mo3rfan / socks.pac
Last active October 20, 2022 09:22
🧦📦
function FindProxyForURL(url, host) { return "SOCKS localhost:5959; }
(gci *.mp4 -Recurse | sort CreationTime | % { $_.FullName }).ForEach({ "file '{0}'" -f $_ }) > concat.txt && ffmpeg.exe -f concat -safe 0 -fflags +genpts -i .\concat.txt -y -c copy ../output.mp4
gci *.mp4 -Recurse | %{
$invcmd = "ffprobe -hide_banner -show_entries stream=codec_type -of default=nw=1 -loglevel error -i $_"
Invoke-Expression $invcmd 2>&1 | Out-Null
if (-not $? -or $LASTEXITCODE -ne 0) {
echo "Deleting $_"
Remove-Item $_
}
}
@mo3rfan
mo3rfan / lossybox.vbs
Last active March 18, 2016 19:14
Monitor dropbox screenshots folder and convert (and replace) the default PNGs to a lossy JPEG using imageMagick on windows.
strComputer = "."
Set oShell = WScript.CreateObject("WScript.Shell")
user = oShell.ExpandEnvironmentStrings("%USERNAME%")
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colMonitoredEvents = objWMIService.ExecNotificationQuery _
("Select * From __InstanceOperationEvent Within 2 Where " _
@mo3rfan
mo3rfan / 0_reuse_code.js
Last active August 29, 2015 14:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mo3rfan
mo3rfan / makedevs
Last active August 29, 2015 14:19
Small shell script to create users, assign them to a single group, give them a common working directory and also add a bit of git pre-config on user login.
#!/bin/bash
userlist=( "foo" "bar" )
groupname="Developers"
passwd="123456"
for i in "${userlist[@]}"; do
sudo useradd $i -d /home/$i -g $groupname -m -N -p $passwd
sudo mkdir /home/$i/.ssh
sudo touch /home/$i/.ssh/authorized_keys
@mo3rfan
mo3rfan / dabblet.css
Created September 1, 2012 14:05
Cyanogenmod9+ Loading bar spinoff?
/**
* Cyanogenmod9+ Loading bar spinoff?
* CSS3. The animation is not exactly same, nor do I like it that way.
*
* Author: Power-Inside
*/
body {
min-height: 100%;
background: #000;