Skip to content

Instantly share code, notes, and snippets.

@prodehghan
prodehghan / German Chars on US Keyboard.ahk
Last active April 18, 2022 12:58
With this script, you can type German's characters (umlauts and ß) using the Right Alt key on a US keyboard
>!u::Send {Text}ü ; RAlt+u => ü
>!+u::Send {Text}Ü ; RAlt+Shift+u => Ü
>!a::Send {Text}ä ; RAlt+a => ä
>!+a::Send {Text}Ä ; RAlt+Shift+a => Ä
>!o::Send {Text}ö ; RAlt+o => ö
>!+o::Send {Text}Ö ; RAlt+Shift+o => Ö
>!s::Send {Text}ß ; RAlt+s => ß
@prodehghan
prodehghan / convert-all-x265.ps1
Last active August 10, 2020 14:27
Converts/compresses all video (.mp4 and .mov) files in current directory to x265
if (!(Test-Path -Path "c" -PathType Container)) {
mkdir "c"
}
$files = Get-ChildItem ("*.mp4", "*.mov")
$index = 0
$total = $files.Length
foreach ($file in $files) {
$index++
Write-Host "***** ($index/$total) $($file.Name)" -ForegroundColor Magenta
ffmpeg -hide_banner -i $file -map_metadata 0 -movflags use_metadata_tags -c:v libx265 -preset slow -crf 26 -c:a aac -b:a 64k $("c\" + $file.BaseName + ".mp4")
@prodehghan
prodehghan / convert-all - x265-stab=smoothing=8,unsharp.ps1
Last active August 17, 2021 20:17
Converts/compresses and de-shakes all video files (.mp4 and .mov) in current directory to x265
[CmdletBinding()]
param(
[Alias("i")]$inputFiles,
[Alias("op")]$outputPath
)
if ($null -eq $inputFiles) {
$inputFiles = ("*.mp4", "*.mov")
}
if ($null -eq $outputPath) {
Write-Host -ForegroundColor Cyan "Output path not provided. Defaults to '.\c'"
@prodehghan
prodehghan / activeDirectoryUserSearch.js
Created March 18, 2020 16:03
A sample node script for searching in Active Directory users, using "activedirectory2" package
var ActiveDirectory = require('activedirectory2');
var config = { url: 'ldap://sgdc.SYSTEMGROUP.NET',
baseDN: 'dc=systemgroup,dc=net',
username: 'mohammadhd@systemgroup.net',
password: 'your_password' }
var ad = new ActiveDirectory(config);
var query = 'sAMAccountName=MohammadHD';
ad.find(query, function(err, result) {
@prodehghan
prodehghan / activeDirectoryTest.js
Created March 18, 2020 16:00
A test for active directory authentication, using "ldapauth-fork" library
var LdapAuth = require('ldapauth-fork');
var ldap = new LdapAuth({
url: 'ldap://sgdc.SYSTEMGROUP.NET',
bindDN: "mohammadhd@systemgroup.net",//"CN=MohammadHasan Dehghan,OU=Users,OU=MIS,OU=VNK,OU=SG Main,DC=systemgroup,DC=net",
bindCredentials: 'your_password', // <-- supply a valid email and password
searchBase: 'DC=systemgroup,DC=net',
searchFilter: '(|(samaccountname={{username}})(mail={{username}}))',
reconnect: true
});