Skip to content

Instantly share code, notes, and snippets.

View coffnix's full-sized avatar

Raphael Bastos aka coffnix coffnix

View GitHub Profile
#!/bin/bash
# cpustatus
#
# Prints the current state of the CPU like temperature, voltage and speed.
# The temperature is reported in degrees Celsius (C) while
# the CPU speed is calculated in megahertz (MHz).
function convert_to_MHz {
let value=$1/1000
echo "$value"
#!/usr/bin/env python
import os
import random
os.system('clear')
Problema = [ "A greve", "O foro de Sao Paulo", "O Stalinismo", "A desigualdade", "Cuba Socialista", "O Golpe de 1964" ]
Natureza = [ "e uma invencao", "e uma estrategia", "e uma manobra", "e um complo", "e uma bandeira", "e uma falacia" ]
Culpado = [ "do Fidel Castro", "dos sindicalistas", "dos baderneiros", "dos petralhas", "dos idiotas uteis", "do MEC" ]
#!/usr/bin/env python
import os
import random
os.system('clear')
Problema = [ "A miseria", "A inflacao", "O desemprego", "A violencia", "A crise", "O crime" ]
Natureza = [ "e uma invencao", "e uma estrategia", "e uma manobra", "e um complo", "e uma instituicao", "e uma criacao" ]
Culpado = [ "da burguesia", "do imperialismo americano", "das elites", "da oposicao", "do capitalismo", "das politicas neoliberais" ]
@coffnix
coffnix / Freenode IRC.md
Created September 18, 2018 12:48 — forked from yeyewangwang/Freenode IRC.md
Freenode Nickserv Commands

Connect

/server chat.freenode.net

Nick

@coffnix
coffnix / InstaPy scripts
Last active June 21, 2021 00:33
InstaPy scripts
emerge >=dev-python/selenium-3.13.0 >=dev-python/PyVirtualDisplay-0.2.1 >=www-apps/chromedriver-bin-2.41
pip install --user easyprocess
pip install --user clarifai
pip install --user emoji
pip install --user plyer
git clone https://github.com/timgrossmann/InstaPy
cd InstaPy
cp /usr/bin/chromedriver assets/chromedriver -p
Rule Brazil 2017 only - Feb 19 00:00 0 -
Rule Brazil 2017 only - Oct 15 00:00 1 S
Rule Brazil 2018 only - Feb 18 00:00 0 -
Rule Brazil 2018 only - Nov 18 00:00 1 S
Rule Brazil 2019 only - Feb 17 00:00 0 -
Rule Brazil 2019 only - Oct 20 00:00 1 S
Rule Brazil 2020 only - Feb 16 00:00 0 -
Rule Brazil 2020 only - Oct 18 00:00 0 -
Rule Brazil 2021 only - Feb 21 00:00 0 -
Rule Brazil 2021 only - Oct 17 00:00 1 S
#!/bin/bash
# Necessario configurar no /etc/crontab a seguinte linha:
#
# */30 * * * * zabbix /etc/zabbix/scripts/dnsbl.sh
#
##########################################################
# Debug
#set -x
@coffnix
coffnix / test-lock.sh
Created December 10, 2018 14:00
lock em bash script
#!/bin/bash
###############################################################################
# Testa se script já encontra-se em execução
test_running() {
RUNNING=$(ps aux | grep "$(printf '%s\n' "${0##*/}")" | grep bash | grep -v "bash -c" | grep -v $$ | grep -v grep | wc -l)
if [ ${RUNNING} -gt 1 ]; then
echo "Script ja esta rodando, aguardando 10 segundos para tentar novamente."
sleep 10
@coffnix
coffnix / extract funtoo image on raspi3b+
Last active December 22, 2018 07:21
GEN image raspi3b+ funtoo linux Raw
# descompacte no sdcard novo:
mkdir /pendrive;mount /dev/mmcblk0p2 /pendrive/;mount /dev/mmcblk0p1 /pendrive/boot
tar xjpf funtoo-raspi3-22-12-2018.tar.bz2 -C /pendrive
# troca senha pra root
sed -i /'root:'/d /pendrive/etc/shadow
sed -i '1i root:$6$RmC.Jho1o/9n/.7X$aMOtiIZC3hoLaJJJ3ZW2Do7IRlSMuDWh5qUvaG9beIIFO92kWYJmrxAARypJA/g3zj4/wbq7rumQorw6lOMTE.:17846:0:::::' /pendrive/etc/shadow
#!/usr/bin/env python
import os
import random
os.system('clear')
Problema = [ "O estatuto do desarmamento", "O controle de armas", "Os decretos frageis de armas", "A inseguranca juridica do CAC", "A falta de leis para porte do CAC", "A restricao de calibres" ]
Natureza = [ "e uma invencao", "e uma estrategia", "e uma manobra", "e um complo", "e uma bandeira", "e uma falacia" ]
Culpado = [ "do Fidel Castro", "dos sindicalistas", "dos baderneiros", "dos petralhas", "dos idiotas uteis", "do MEC" ]