Skip to content

Instantly share code, notes, and snippets.

View luismrsilva's full-sized avatar

Luís Silva luismrsilva

  • Instituto Superior Técnico
  • Portugal
View GitHub Profile
@luismrsilva
luismrsilva / wifi_qr.sh
Created July 11, 2020 01:35
Generate Wifi QR on terminal after asking for SSID and PASSWORD
#!/bin/bash
# Generate Wifi QR on terminal after asking for SSID and PASSWORD
# 2020-07-11 luismrsilva
# Show SVG (needs X)
# qrencode -t svg -o /dev/fd/1 -s 10 | display /dev/fd/0
# Show on terminal
# qrencode -t ANSI
@luismrsilva
luismrsilva / overlay.sh
Last active November 4, 2023 20:24
Overlay logo over image, resizing logo to x% of the smallest dimension of the image
#!/bin/bash
# Author: https://github.com/luismrsilva
# (c) 2019 luismrsilva
# Config
## percent of smaller dimension of image
## this size will be used on the largest side of the logo
LOGO_PERCENT=25
@luismrsilva
luismrsilva / choose-layout.sh
Last active October 10, 2021 14:04
Present a menu to select and apply a screen layout script
#!/bin/bash
# present a menu to select and apply a screen layout script
# requires "arandr" and "dialog" package
# to run with hotkeys, use:
# lxterminal -e choose-layout.sh
# 2018-11-27 L
# from https://gist.github.com/luismrsilva/07b280d990ae26d038310219c1e1a742
@luismrsilva
luismrsilva / afs_git_repo_howto.md
Last active July 11, 2020 03:41
How to share a git repo on Técnico's AFS

How to share a git repo on Técnico's AFS

This is only for people with access to it, such as Técnico's students.

We will connect to sigma via SSH to make and share a directory using AFS ACL and init an empty git repository in it.

Connect to sigma and share a new directory

To connect to sigma, open a Terminal and run:

$ ssh ist1XXXXX@sigma.tecnico.ulisboa.pt
@luismrsilva
luismrsilva / shell_stuff.reg
Created October 23, 2017 12:46
Add "Cmd Here" and "Copy Path" to Windows Shell
Windows Registry Editor Version 5.00
; copy path for files
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\copypath]
@="Copy Path"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\copypath\command]
@="cmd.exe /c \"echo %1 | clip\""
@luismrsilva
luismrsilva / ffwraper.sh
Created June 30, 2017 05:28
Wrapper to fix video rotation on ffmpegthumbnailer
#!/bin/bash
# WARNING: this file is provided AS IS without ANY WARRANTY.
# USE AT YOUR OWN RISK
# Installation on Ubuntu
# - Copy ffwraper.sh to /usr/share/thumbnailers
# - In ffmpegthumbnailer.thumbnailer, set:
# Exec=/usr/share/thumbnailers/ffwraper.sh -i %i -o %o -s %s
@luismrsilva
luismrsilva / gl-pthread-fix.cpp
Last active April 21, 2018 04:03
Fix for segmentation fault before main when using OpenGL functions AND std under Linux Ubuntu.
/*
Fix for segmentation fault before main
when Using OpenGL functions AND std
under Linux Ubuntu.
2016-10-25 luismrsilva
@luismrsilva
luismrsilva / git-hours.sh
Last active January 19, 2017 18:54
Estimate git repository working hours by adding time between commits (for a given optional author)
#!/bin/bash
# Estimate repository working hours by adding time between commits.
# If diference between two commits is larger than THRESHOLD, PRECOMMIT_TIME is used instead.
# 2016-06-06 luismrsilva
# (c) 2016 by Luís Silva.
# Disclamer: use at your own risk.