Skip to content

Instantly share code, notes, and snippets.

@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 / ttf-ms-tahoma-installer.sh
Last active March 15, 2024 13:14
Script to install the original Microsoft Tahoma font on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the original Microsoft Tahoma Regular and MS Tahoma Bold (both version 2.60) on Ubuntu distros.
# Dependencies: wget and cabextract
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
output_dir="/usr/share/fonts/truetype/msttcorefonts/"
tmp_dir="/tmp/ttf-ms-tahoma-installer"
@maxwelleite
maxwelleite / ttf-wine-tahoma-installer.sh
Last active October 16, 2023 13:15
Script to install the latest Wine Tahoma fonts on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the latest Wine Tahoma Regular and Wine Tahoma Bold fonts on Ubuntu distros from the Wine Project.
# The Wine project includes the free and open-source fonts Wine Tahoma Regular and Wine Tahoma Bold released under LGPL
# designed to have identical metrics to the Microsoft Tahoma font. This was done because Tahoma is available by default
# on Windows, and many applications expect the font to be available.
# Dependencies: wget
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
# Latest Update: 20/11/2020
@maxwelleite
maxwelleite / Win10-Initial-Setup-Script-Execute.cmd
Last active June 16, 2023 23:05
Batch script to download latest Win10-Initial-Setup-Script and execute using your own local profile Win10-Initial-Setup-Script-Execute.preset (change before execute).
@echo off
:: Author: Maxwel Leite
:: Website: http://needforbits.wordpress.com/
:: Description: Batch script to download latest Win10-Initial-Setup-Script*
:: and execute using your own local profile Win10-Initial-Setup-Script-Execute.preset (change before execute).
:: * PowerShell script for automation of routine tasks done after fresh installations of Windows 10 / Server 2016 / Server 2019
:: (https://github.com/Win10debloater/Win10-Initial-Setup-Script)
::
if not "%1"=="am_admin" call powershell -h | %WINDIR%\System32\find.exe /i "powershell" > nul && if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin > nul & exit)
@maxwelleite
maxwelleite / timestampit.sh
Last active August 2, 2022 08:12
timestampit - add a timestamp to command output in Linux
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Initial Author: Abdullah Diab (http://mpcabd.xyz/adding-a-timestamp-to-command-output-in-linux/)
# Description: Simple bash script to add a timestamp to command output in Linux
# This is just a quick solution to put a timestamp with each line of the output of some command in Linux.
while read x; do
# RFC-3339 format - for more accuracy and works with syslog
echo -n `date --rfc-3339=ns | sed 's/ /T/; s/\(\....\).*-/\1-/g'`;
echo -n " ";
@maxwelleite
maxwelleite / Windows10Debloater-Execute-only-Debloat.cmd
Last active January 22, 2021 16:28
Batch script to download latest Windows10Debloater script and execute for remove all bloatware from Windows 10 (only Debloat)
@echo off
:: Author: Maxwel Leite
:: Website: http://needforbits.wordpress.com/
:: Description: Batch script to download latest Windows10Debloater* script
:: and execute for remove all bloatware from Windows 10 (only Debloat).
:: * Script to remove Windows 10 bloatware (https://github.com/Sycnex/Windows10Debloater)
::
if not "%1"=="am_admin" call powershell -h | %WINDIR%\System32\find.exe /i "powershell" > nul && if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin > nul & exit)
setlocal
@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 / mkv-substrip.sh
Last active July 14, 2019 04:16
mkv-substrip.sh - Remove all subtitle tracks (strip) from all MKV files in a specified folder or file
#!/bin/bash
# file-name: mkv-substrip.sh
# Website: http://needforbits.tumblr.com/
# https://gist.github.com/maxwelleite
# https://github.com/maxwelleite
# Author: Maxwel Leite
# License: GPLv3
# Description: Remove all subtitle tracks (strip) from all MKV files in a specified folder or file,
# then put the new mkv file(s) in a previously-created sub-folder named "output".
# Param: "folder" (with a least one mkv file) or "file.mkv" (*relative paths also works*)
@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 / 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