Skip to content

Instantly share code, notes, and snippets.

View samirfor's full-sized avatar

Samir C. Costa samirfor

  • Brazil
  • 05:23 (UTC -03:00)
View GitHub Profile
@samirfor
samirfor / palemoon.32b.install.on.manjaro.linux.64b.sh
Created February 27, 2018 13:10
Installing Palemoon 32 bits on Manjaro Linux 64 bits
#!/bin/sh
set -e
echo "== Installing Palemoon 32 bits on Manjaro Linux 64 bits =="
echo
echo "Installing deps (lib32) ..."
echo
yaourt -S --noconfirm lib32-gtk2 lib32-dbus-glib bin-jre7
echo
echo 'Acquire::http { Proxy "http://10.80.1.35:3142"; };' > /etc/apt/apt.conf.d/00aptproxy && apt update && apt dist-upgrade -y
@samirfor
samirfor / send-mail.sh
Created August 7, 2017 15:01
Send a e-mail using mailx software
#!/bin/bash
EMAIL_SUBJECT="Desligamento agendado `date +%d/%m/%Y`"
FROM_EMAIL_ADDRESS="[email protected]"
FROM_EMAIL_PASSWORD="password"
FRIENDLY_NAME="Fela de Tal"
STMP_HOST="mail.chupa.br:587"
echo -e "Olá, os servidores serão \
desligados dentro de 30 minutos. \
@samirfor
samirfor / mongo_backup.sh
Last active May 10, 2017 13:17 — forked from sheharyarn/mongo_backup.sh
Mongodump All Databases Shell Script for Cronjob
#!/bin/sh
set -e
HOST_NAME="$(hostname)"
MONGO_HOST="127.0.0.1"
MONGO_PORT=27017
MONGO_USER="admin"
MONGO_PASS="password"
MONGO_AUTHDB="admin"
>>> import spotipy
>>> import sys
>>> import pprint
>>>
>>> if len(sys.argv) > 1:
... urn = sys.argv[1]
... else:
... urn = 'spotify:artist:3jOstUTkEu2JkjvRdBA5Gu'
...
>>> sp = spotipy.Spotify()
@samirfor
samirfor / bareos_ports_templates.xml
Created March 10, 2017 17:29
Zabbix 3.0 Bareos Ports Template (Client, Storage, Director)
<?xml version="1.0" encoding="UTF-8"?>
<zabbix_export>
<version>3.0</version>
<date>2017-03-10T17:15:52Z</date>
<groups>
<group>
<name>Templates</name>
</group>
</groups>
<templates>
@samirfor
samirfor / ssh-tor.sh
Last active February 23, 2017 14:47
Tunnel SSH connection through Tor network
#!/bin/bash
#
# install:
#
# echo "alias ssh-tor=/path/to/this/script/ssh-tor.sh" >> ~/.bash_aliases
# . ~/.bash_aliases
#
# usage:
# - start Tor Browser
@samirfor
samirfor / play_when_process_done.sh
Created February 1, 2017 16:51
Bash script to play a song when a process ends.
#!/bin/bash
# Bash script to play a song when a process ends.
# License MIT <https://opensource.org/licenses/MIT>
# Author: @samirfor
PID=$1
SONGFILE=$2
if [ "${PID}x" = "x" ] || [ ! -r "${SONGFILE}" ]; then