Skip to content

Instantly share code, notes, and snippets.

@maxwelleite
maxwelleite / mediatomb-wipe-db.sh
Last active August 29, 2015 13:57
Forces to wipe/cleanup entire database of MediaTomb (UPnP Media Server - DLNA)
#!/bin/bash
#
# Author: Maxwel Leite
# Website: http://needforbits.tumblr.com/
#
# Description:
# Forces to wipe/cleanup entire database of MediaTomb (UPnP Media Server - DLNA)
#
# Dependencies: sqlite3
#
@maxwelleite
maxwelleite / gnome-shell-enable-all-extensions.sh
Last active October 6, 2018 13:19
Simple Bash script for enable all extensions in Gnome Shell on startup
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
#
# INSTALL:
# To activate/enable all extensions every time at startup:
# 1. Create a folder for your own scripts:
# mkdir ~/bin
# 2. Download a script file gnome-shell-enable-all-extensions.sh to "~/bin":
# 3. Setting up permissions for the script file:
@maxwelleite
maxwelleite / ffmpeg-updater.sh
Last active August 21, 2017 01:41
Simple bash script to install the latest static version of FFmpeg (from http://ffmpeg.gusari.org/static/)
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Simple bash script to install the latest static version of FFmpeg (from http://ffmpeg.gusari.org/static/)
# Dependencies: wget
# Tested: Ubuntu Saucy
if [[ $EUID -ne 0 ]]; then
echo -e "You must be a root user!\nTry: sudo ./ffmpeg-update.sh" 2>&1
exit 1
@maxwelleite
maxwelleite / ttf-vista-fonts-installer.sh
Last active April 4, 2024 20:14
Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install Microsoft Vista TrueType Fonts (TTF) aka Microsoft’s ClearType fonts on Ubuntu distros
# Microsoft added a group of new "ClearType Fonts" to Windows with Windows Vista and Office 2007.
# These fonts are named Constantia, Corbel, Calibri, Cambria (and Cambria Math), Candara, and Consolas.
# Calibri became the default font on Microsoft Word 2007, and it’s still the default font on Word 2016 today.
# Dependencies: wget, fontforge and cabextract
# Note: Microsoft no longer provides the PowerPoint Viewer 2007 (v12.0.4518.1014) or any version anymore for download
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
@maxwelleite
maxwelleite / firefox-language-installer.sh
Last active August 21, 2017 01:39
Script to automatic download, install and configure the language pack on Firefox [Ubuntu/Debian distros]
#!/bin/bash
# Author: Maxwel Leite
# file-name: firefox-language-installer.sh
# Website: http://needforbits.wordpress.com/
# Description: Script to automatic download, install and configure the language pack on Firefox [Ubuntu/Debian distros]
# Dependencies: firefox-mozilla-build (Ubuntuzilla Repository) or firefox (obvious!) and wget
# Tested: Ubuntu 14.04 (Trusty), 13,10 (Saucy)
# License: GPLv3
# Note: Also works with Firefox installed from compressed tarball (ex: firefox-33.1.1.tar.bz2)
# TODO: Test in Debian
@maxwelleite
maxwelleite / dropbox-repository-installer.sh
Last active November 17, 2020 19:13
Script to easily install a Dropbox Repository in Debian, Ubuntu and Linux Mint
#!/bin/bash
# Author: Maxwel Leite
# file-name: dropbox-repository-installer.sh
# Website: http://needforbits.wordpress.com/
# Description: Script to easily install a Dropbox Repository in Debian, Ubuntu and Linux Mint
# License: GPLv3
if [[ $EUID -ne 0 ]]; then
echo -e "You must be a root user!\nTry:\n\n sudo ./${0##*/} or sudo bash ${0##*/}" 2>&1
exit
@maxwelleite
maxwelleite / functions-str.sh
Created November 25, 2014 15:47
Collection of useful string functions for BASH programming
#!/bin/bash
# Author: Maxwel Leite
# file-name: functions-str.sh
# Website: http://needforbits.tumblr.com/
# Description: Collection of useful string functions for BASH programming
# License: GPLv3
# Description: Remove leading and trailing whitespace characters
# @param string source string
# usage: result="$(trim " a b c d ")"
@maxwelleite
maxwelleite / getlibs
Last active August 29, 2015 14:12 — forked from linuxundich/getlibs
#!/bin/bash
#The MIT License
#
#Copyright (c) 2007 Cappy
#Permission is hereby granted, free of charge, to any person obtaining a copy
#of this software and associated documentation files (the "Software"), to deal
#in the Software without restriction, including without limitation the rights
#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
#copies of the Software, and to permit persons to whom the Software is
@maxwelleite
maxwelleite / km-0416.ini
Last active March 21, 2017 19:05
Configuração com teclas especiais (Alt+Gr, Cima,Baixo...) para o teclado português-BR para quem utiliza xrdp ou x11rdp - Fonte/tutorial: http://amartinstechnet.blogspot.com.br/2016/09/configurar-teclado-lxde-abnt2-x11rdp.html For more configuration files from another languages: http://c-nergy.be/blog/?p=3858
[noshift]
Key8=0:0
Key9=65307:27
Key10=49:49
Key11=50:50
Key12=51:51
Key13=52:52
Key14=53:53
Key15=54:54
Key16=55:55
@maxwelleite
maxwelleite / kill-idle-vnc.sh
Last active May 20, 2018 01:29 — forked from mnebuerquo/kill-idle-vnc.sh
place in /etc/cron.hourly and it will kill any idle vnc sessions from http://serverfault.com/a/767361/33170
#!/bin/bash
# file-name: kill-idle-vnc.sh
# Author: Maxwel Leite (http://needforbits.wordpress.com/)
# Initial Author: Sherman Adelson (https://gist.github.com/mnebuerquo)
# Description: Script to kill any idle vnc sessions (for disconnected xrdp sessions)
# SRC: http://serverfault.com/a/767361/33170
displays=`ps aux | grep Xvnc | grep -v 'grep\|sed' | sed -r 's|.*(Xvnc :[0-9]*).*|\1|' | cut -d' ' -f 2`
limit=30 # in minutes