Skip to content

Instantly share code, notes, and snippets.

View WeaponMan's full-sized avatar

Ondřej Kotora WeaponMan

  • Česká republika
View GitHub Profile
@WeaponMan
WeaponMan / PKGBUILD
Created September 24, 2022 10:36
i3-title-fix
# Maintainer: Jan-Erik Rediger <badboy at archlinux dot us>
# Contributor: Thorsten Toepper <atsutane at freethoughts dot de>
# Contributor: William Giokas <1007380@gmail.com>
# This PKGBUILD was prepared for pacman 4.1 by William. Thank you. :-)
pkgname=i3-git
pkgver=4.13.r1759.g5f6c4a92
pkgrel=1
pkgdesc='An improved dynamic tiling window manager'
@WeaponMan
WeaponMan / gstreamer-hls-nvidia-enc-dec.sh
Last active October 23, 2021 08:01
Gstreamer HLS multiple quality, creates 3 hls playlists (480p@30, 720p@30, 1080p@30) from RSTP source
# if your system doesnt have faac in repos (eg. Debian) replace it with voaacenc
gst-launch-1.0 rtspsrc location="rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov" latency=10000 name=source \
source. ! queue ! "application/x-rtp, media=(string)video" ! rtph264depay ! h264parse ! nvh264dec ! tee name=video \
source. ! queue ! "application/x-rtp, media=(string)audio" ! rtpmp4gdepay ! decodebin ! audioconvert ! audioresample ! faac bitrate=128000 ! "audio/mpeg,rate=(int)44100" ! tee name=audio \
video. ! queue ! videoconvert ! videoscale ! videorate ! "video/x-raw,width=842, height=480,framerate=30/1" ! nvh264enc bitrate=1280 ! "video/x-h264,profile=(string)baseline" ! mux480. \
audio. ! queue ! mux480. \
video. ! queue ! videoconvert ! videoscale ! videorate ! "video/x-raw,width=1280, height=720,framerate=30/1" ! nvh264enc bitrate=2560 ! "video/x-h264,profile=(string)baseline" ! mux720. \
audio. ! queue ! mux720. \
video. ! queue ! videoconvert ! videoscale ! videorate ! "video/x-
@WeaponMan
WeaponMan / app-name.exe.manifest
Created July 11, 2020 22:03
Windows Resources version rust
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator" uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
@WeaponMan
WeaponMan / Ldap.java
Created November 19, 2017 14:01
Pure Java ldap
Hashtable env = new Hashtable(11);
authEnv.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
authEnv.put(Context.PROVIDER_URL, "ldap://ldap.example.com:389";);
authEnv.put(Context.SECURITY_AUTHENTICATION, "simple");
authEnv.put(Context.SECURITY_PRINCIPAL, userName);
authEnv.put(Context.SECURITY_CREDENTIALS, passWord);
try {
DirContext authContext = new InitialDirContext(authEnv);
} catch (AuthenticationException authEx) {
System.out.println("Authentication failed!");
@WeaponMan
WeaponMan / ISO9797Algorithm3.php
Last active May 29, 2016 14:29
ISO9797 MAC algorithm 3
<?php
class ISO9797Algorithm3 {
const BLOCK_SIZE = 8;
const KEY_SIZE = 8;
public static function generate($input, $key) {
$inputChunked = str_split($input, self::BLOCK_SIZE);
$desKeys = self::splitKey($key);
$output = str_pad("", self::BLOCK_SIZE, "\0");