Skip to content

Instantly share code, notes, and snippets.

View maz-1's full-sized avatar
🐢
slow to respond

maz-1 maz-1

🐢
slow to respond
  • WolkenVision AG
  • China
View GitHub Profile
#!/bin/bash
# <bitbar.title>Emoji Active Network Interface Indicator</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>Zachary O. Toups</bitbar.author>
# <bitbar.author.github>toupsz</bitbar.author.github>
# <bitbar.desc>Displays an emoji to indicate if the active network interface is wifi or another connection.</bitbar.desc>
# <bitbar.image>https://dept-wp.nmsu.edu/pixl/files/2018/06/EANII-image.png</bitbar.image>
# <bitbar.dependencies>bash</bitbar.dependencies>
# <bitbar.abouturl>https://github.com/toupsz/emoji-active-network-interface-indicator</bitbar.abouturl>
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <signal.h>
#include <string.h>
//#define LIB_PYTHON_PATH "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/Python"
typedef void (*PY_SETPROGNAME)(char *);
typedef void (*PY_INIT)();
@maz-1
maz-1 / panic.log
Last active February 23, 2019 17:05
Anonymous UUID: 804731C5-9F3B-E3A6-54C3-9863724E2424
Sun Feb 24 00:57:20 2019
*** Panic Report ***
panic(cpu 4 caller 0xffffff8002ada29d): Kernel trap at 0xffffff7f874595de, type 14=page fault, registers:
CR0: 0x000000008001003b, CR2: 0x0000000000000000, CR3: 0x000000001a647000, CR4: 0x00000000003626e0
RAX: 0x0000000000000000, RBX: 0xffffff8201598160, RCX: 0xffffff81f3b03d78, RDX: 0x00000000015d0000
RSP: 0xffffff81f3b03e20, RBP: 0xffffff81f3b03e50, RSI: 0xffffff8036648630, RDI: 0x0000000000000000
R8: 0xffffff800329e0a0, R9: 0x0000000000000000, R10: 0xffffff800329e100, R11: 0xffffff80033edc80
@maz-1
maz-1 / PKGBUILD
Created September 20, 2018 20:25
python-pycrypto
# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Josip Ponjavic <josipponjavic at gmail dot com>
pkgbase=python-pycrypto
pkgname=('python-pycrypto' 'python2-pycrypto')
pkgver=2.6.1
pkgrel=2
license=('BSD')
arch=('x86_64')
url='http://www.pycryptodome.org/'
#!/bin/sh
convert $input -colorspace gray ( +clone -blur 15,15 ) -compose Divide_Src -composite -normalize -threshold 80% $output
convert $input -colorspace gray ( +clone -blur 15,15 ) -compose Divide_Src -composite -normalize $output
convert $input -colorspace RGB ( +clone -blur 15,15 ) -compose Divide_Src -composite -normalize -threshold 80% $output
convert $input -colorspace RGB ( +clone -blur 15,15 ) -compose Divide_Src -composite -normalize $output
@maz-1
maz-1 / 99_rmecho
Last active August 29, 2018 05:23
#!/bin/bash
argument () {
opt=$1
shift
if test $# -eq 0; then
exit 1
fi
echo $1
}
#!/bin/sh
#/etc/X11/xinit/xinitrc.d/kde-gtk-hidpi.sh
#dependencies: crudini, xsettingsd
if [ "z$XDG_SESSION_DESKTOP" = "zKDE" ]
then
ScaleFactor=$(crudini --get $HOME/.config/kdeglobals KScreen ScaleFactor || echo 1)
export GDK_SCALE=$ScaleFactor
export GDK_DPI_SCALE=$(echo "scale=1;1/$ScaleFactor"|bc|sed 's/^\./0./')
smallSize=$(printf %.0f $(echo "scale=0;12*$ScaleFactor"|bc))
#!/bin/sh
LANG=C pacman -Qi | grep 'Name\|Size\|Description' | cut -d: -f2 | \
paste - - - | awk -F'\t' 'BEGIN{ s["MiB"]=1024; s["KiB"]=1;} {split($3, a, " "); print a[1] * s[a[2]], "KiB", $1}' | sort -n
LANG=C pacman -Qidt | grep 'Name\|Size\|Description' | cut -d: -f2 | \
paste - - - | awk -F'\t' 'BEGIN{ s["MiB"]=1024; s["KiB"]=1;} {split($3, a, " "); print a[1] * s[a[2]], "KiB", $1}' | sort -n
@maz-1
maz-1 / sudo
Last active August 26, 2018 04:26
#!/bin/sh
stampfile=/tmp/sudo.${USER}.stamp
if [[ -t 1 ]]
then
if (test -f ${stampfile} && test `find "${stampfile}" -mmin +180`) || [ ! -f ${stampfile} ]
then
read -p "Are you sure to invoke this command in administrator mode? [Y/n] " answer
case $(echo $answer | tr [:upper:] [:lower:]) in
#!/bin/sh
#/etc/X11/xinit/xinitrc.d/90-vdpau_va_gl.sh
vdriver=$(/usr/bin/vdpauinfo 2>&1 | /usr/bin/grep -oP "(?<=Failed to open VDPAU backend libvdpau_).*(?=\.so)")
if [[ "z$vdriver" = "zi965" || "z$vdriver" = "zi915" ]]
then
export VDPAU_DRIVER=va_gl
fi