Skip to content

Instantly share code, notes, and snippets.

View pmcfernandes's full-sized avatar
🏠
Working from home

Pedro Fernandes pmcfernandes

🏠
Working from home
View GitHub Profile
@pmcfernandes
pmcfernandes / .tmux.conf
Last active February 27, 2021 13:45
Tmux install and config
# 0 is too far from ` ;)
set -g base-index 1
setw -g mouse on
set-option -g default-terminal "screen-256color"
set-option -ga terminal-overrides ",xterm-256color:Tc"
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
@pmcfernandes
pmcfernandes / install.sh
Last active February 26, 2021 23:53
Install my software in alpine
#!/bin/bash
apk add sudo alsa-utils alsa-utils-doc alsa-lib alsaconf neofetch htop bc \
alpine-sdk nodejs npm python3 mutt mc w3m tmux zsh cmus mplayer \
weechat
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
addgroup $USER audio
addgroup root audio
@pmcfernandes
pmcfernandes / .mailcap
Last active February 25, 2021 20:18
mutt install & config
text/html; "$BROWSER" %s &; test=test -n "$DISPLAY"; needsterminal;
text/html; w3m -I %{charset} -T text/html; copiousoutput;
@pmcfernandes
pmcfernandes / update-wp.ps1
Last active May 31, 2019 17:56
Update all instances of wordpress in a parent folder
# Tool to update wordpress website in Windows
# Author: Pedro Fernandes
# update-wp.ps1
param([String]$spaces = "E:\HostingSpaces")
Write-Host "update-wp.ps1- Tool update wordpress website in Windows"
Write-Host "Usage:"
Write-Host " -spaces: Location of WebSites in local system"
Write-Host ""
# Tool create wordpress website in Windows and install in IIS
# and create database in mysql
# Author: Pedro Fernandes
# create-wp.ps1
param([String]$site = "mywebsite.com", [String]$u='root', [String]$p='P@ssw0rd')
Write-Host "create-wp.ps1- Tool create wordpress website in Windows"
Write-Host "Usage:"
Write-Host " -site: [mywebsite.com] Domain name"
@pmcfernandes
pmcfernandes / DeleteZeroFiles.ps1
Created May 28, 2019 11:58
Delete all empty files from a directory recursively (Normally files cleaned by ESET File Security)
Get-ChildItem -Path C:\HostingSpaces -Recurse -Include *.php | Where {$_.Length -eq 0} | remove-Item
######################################
# INSTALL OPENCV ON UBUNTU OR DEBIAN #
######################################
# | THIS SCRIPT IS TESTED CORRECTLY ON |
# |------------------------------------------------------|
# | OS | OpenCV | Test | Last test |
# |------------------|--------------|------|-------------|
# | Ubuntu 18.04 LTS | OpenCV 3.4.2 | OK | 18 Jul 2018 |
# | Debian 9.5 | OpenCV 3.4.2 | OK | 18 Jul 2018 |
@pmcfernandes
pmcfernandes / Start-Pomodoro.ps1
Created April 29, 2019 16:30 — forked from SQLvariant/Start-Pomodoro.ps1
A PowerShell function to create Pomodoro timer. Defaults to 25 minute timer.
<# PLEASE NOTE: I am not the original author of this function.
I found it online years ago, and have been using it ever since.
If you are the original author, please ping me and let me know,
so I can give you proper credit.
#>
Function Start-Pomodoro
{
Param (
[int]$Minutes = 25
)
$app = Get-WmiObject -Class Win32_Product | Where-Object {
$_.Name -match "Microsoft .NET Core SDK"
}
Write-Host $app.Name
Write-Host $app.IdentifyingNumber
pushd $env:SYSTEMROOT\System32
$app.identifyingnumber |% { Start-Process msiexec -wait -ArgumentList "/x $_" }
@pmcfernandes
pmcfernandes / mysqldump.ps1
Last active October 11, 2018 16:28
Backup all databases in a mysql server
# Tool for mysql backup of all databases in an server.
# Author: Pedro Fernandes
# mysqldump.ps1
param([String]$s='localhost', [String]$u='root', [String]$p='P@ssw0rd', [String]$out='C:\Backups')
Write-Host "mysqldump.ps1 - Tool for mysql backup of all databases in an server."
Write-Host "Usage:"
Write-Host " -s: [localhost] Servername or IP address"
Write-Host " -u: [root] Username"