Skip to content

Instantly share code, notes, and snippets.

@ZiTAL
ZiTAL / rebase.py
Created Jan 13, 2021
git: rebase, count all commits to get rebase command
View rebase.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import re
import subprocess
""" GIT LOG EXAMPLE:
0eccd52 (HEAD -> froga) 02 # <- COUNT: FROM THIS
67239d6 01
fb3c480 12
View gist:10cd50e62d181615bf696520c8a9b159
#!/bin/bash
ffmpeg -i input.mp4 -vf eq=brightness=0.08 -c:a copy output.mp4
@ZiTAL
ZiTAL / temp.sh
Created Nov 11, 2020
Rasberry pi temperature script
View temp.sh
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
gpu=$(/opt/vc/bin/vcgencmd measure_temp)
gpu=${gpu/temp=/}
gpu=${gpu/\'C/}
echo "$(date) @ $(hostname)"
@ZiTAL
ZiTAL / Xwrapper.config
Created Oct 27, 2020
xrdp: solve blank screen login
View Xwrapper.config
# /etc/X11/Xwrapper.config
allowed_users = anybody
@ZiTAL
ZiTAL / 000-default.conf
Last active Oct 22, 2020
apache: multi local subdomain to domain public folder
View 000-default.conf
VirtualHost *:80>
ServerAdmin zital@riseup.net
ServerName zital-pi.no-ip.org
<Directory "/var/www/html">
Require all denied
</Directory>
RewriteEngine on
RewriteRule "^/bermiotarra$" "/bermiotarra/" [L,R=301]
@ZiTAL
ZiTAL / TwitterRemoveFavRT.js
Last active Jan 1, 2021
js: Twitter-en erabiltzailien FAV,RT eta SUSTATU-ek kenduteko script-e Tampermonkey add-on-entzat
View TwitterRemoveFavRT.js
// ==UserScript==
// @name TwitterRemoveFavRT
// @namespace TwitterRemoveFavRT
// @description Twitter-eko FAV, RT eta SUSTATU-tako txiuek kenduteko script-tsue
// @include https://*.twitter.com/*
// @grant none
// @version 1
// @license AGPL v3
// ==/UserScript==
@ZiTAL
ZiTAL / clean_words_merged.py
Last active Sep 15, 2020
python3: read xml
View clean_words_merged.py
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from lxml import etree
import re
file = open("words_merged.xml", "r")
dom = etree.parse(file)
wl = dom.xpath('//wordlist/w')
@ZiTAL
ZiTAL / random-near-numbers.js
Created Jun 19, 2020
js: random near numbers
View random-near-numbers.js
class RandomNearNumbersClass
{
_random(min, max)
{
return Math.floor(Math.random() * (max - min + 1) ) + min;
}
_getMinMax(value, amount, min, max)
{
let _min = value - amount;
@ZiTAL
ZiTAL / 01.sh
Last active Jun 17, 2020
lit-element: webpack example
View 01.sh
mkdir -p /home/projects/lit/src/components
cd /home/projects/lit
npm init -y
npm install lit-element webpack webpack-cli --save-dev
touch index.html
touch src/index.js
touch src/components/progress-bar.js
@ZiTAL
ZiTAL / polymer_cli_install.sh
Last active Jun 17, 2020
js: install polymer-cli globally
View polymer_cli_install.sh
npm install -g polymer-cli --unsafe-perm
You can’t perform that action at this time.