Skip to content

Instantly share code, notes, and snippets.

View rewida17's full-sized avatar
💭
Hard working 😄

rewida17

💭
Hard working 😄
  • Poland
View GitHub Profile
@rewida17
rewida17 / mpv.conf
Last active January 19, 2018 21:09
My private config file for mpv using hardware acceleration on ThinkPad T60 (+youtube-dl)
#Configure for HW acceleration
#Put this stuff in ~/.config/mpv/mpv.conf
#My ThinkPad use Radeon X1400
#Add this in bashrc:
#export LIBVA_DRIVER_NAME=vdpau #
#export VDPAU_DRIVER=r600 # test first w/o this variable
#Use in Arch
--hwdec=vdpau
@rewida17
rewida17 / md5comp
Created February 1, 2018 15:01
MD5 compare files #BASH #AWK #MD5
#!/bin/bash
#This part of script is responsible of checking the file
test(){
f1="$(md5sum "$1" | awk '{print $1}')"
f2="$(md5sum "$2" | awk '{print $1}')"
@rewida17
rewida17 / BBC_HLS_RECORD.sh
Last active February 20, 2018 15:35 — forked from John07/HLS_dvr.sh
A small script to make recording http live streams ( HLS ) on a Linux. Script records the stream for a defined period of time and sends the user notifications if anything goes wrong and once it's done.
#!/bin/bash
# required: ffmpeg notify-send or zenity ;)
# you can schedule this with launchd to run e.g. weekly
# Specify in seconds how long the script should record (default here is 1 hour).
seconds=3600
#Specify in miliseconds notify timeout
notify=3000
# Date format for the recording file name
AN-308 TRIAC analog control circuits for inductive loads
http://www.st.com/content/ccc/resource/technical/document/application_note/bf/c5/c3/a5/3b/51/48/af/CD00003856.pdf/files/CD00003856.pdf/jcr:content/translations/en.CD00003856.pdf
@rewida17
rewida17 / airly.sh
Last active April 2, 2018 18:12
Shell based AIRly user iface
#!/bin/bash
APIK="apikey:Your Airly API KEY"
###########################################################################
#
json2txt(){
sed 's/\\\\\//\//g' |\
sed 's/[{}]//g' |\
awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}'|\
sed 's/[\,]/ /g' |\
sed 's/\"//g'
@rewida17
rewida17 / lcd_write.sh
Created May 5, 2018 12:09
Write text to HD44780 via PCF8574T
#!/bin/sh
# 2016 :p raphik
#Mirror!!
# Comando para LCD HD44780 + expansor I2C PCF8574T
# Sintaxis: lcd_write <línea> <texto>
#Source:http://foro.seguridadwireless.net/openwrt/proyecto-gpio-manejo-de-una-pantalla-lcd-via-bus-i2c/?action=printpage
#
func_init() # Init
{
func_LCD I 0x33; func_LCD I 0x32; func_LCD I 0x28; func_LCD I 0x0C; func_LCD I 0x01
#!/bin/bash
#ENJOY
DL(){
conversations_http_downloader.py "$a"
}
#We are in /tmp?
if ! [[ "$PWD" == '/tmp' ]]
then
echo 'Go to /tmp'
ffmpeg -i input.mp4 \
-map 0:1 \
-c:a copy \
-y output.m4a
@rewida17
rewida17 / mpv_conf
Created May 4, 2019 21:47
chromebook Thinkpad 11e mpv.conf
#!/bin/env bash
if ![[ -e ~/.config/mpv/mpf.conf]]
then
mkdir -pv ~/.config/mpv
echo 'LS1od2RlYz12YWFwaQotLXZvPXZhYXBpCi0teXRkbC1mb3JtYXQ9YmVzdHZpZGVvW2hlaWdodDw9PzcyMF1bZnBzPD0/NjBdW3Zjb2RlYyE9P3ZwOV0rYmVzdGF1ZGlvL2Jlc3QKLS12b2x1bWUtbWF4PTIwMAotLXNhdmUtcG9zaXRpb24tb24tcXVpdAo=' |base64 -d > ~/.config/mpv/mpv.conf
elif [[ -e ~/.config/mpv/mpv.conf]]
then
echo -e 'mpv.conf already exist, nothing to do.\\nBye :)'
#!/bin/bash
while IFS= read -r ip
do
snmpwalk -v1 -c public "${ip}" 1.3.6.1.4.1.14988.1.1.3.8.0 | awk -v ip="$ip" '{print ip"=>"$4/10"V"}'
done < <(cat ~/ip)