Skip to content

Instantly share code, notes, and snippets.

View KelvinVenancio's full-sized avatar
🎯
Focusing

Kelvin V. Soares KelvinVenancio

🎯
Focusing
View GitHub Profile
@KelvinVenancio
KelvinVenancio / free-100-digital_ocean
Created June 28, 2020 23:04
Free $100 Digital Ocean
# DigitalOcean Free $100 Credit (Jun 2020)
[Use this link to Sign Up](https://m.do.co/c/396f40a88290)
- Activate your account by credit card or Paypal
- Done! Now you have free $100 credit
:D
@KelvinVenancio
KelvinVenancio / cloudflare-update-record.sh
Created December 1, 2017 19:25 — forked from benkulbertis/cloudflare-update-record.sh
Cloudflare API v4 Dynamic DNS Update in Bash
#!/bin/bash
# CHANGE THESE
auth_email="[email protected]"
auth_key="c2547eb745079dac9320b638f5e225cf483cc5cfdda41" # found in cloudflare account settings
zone_name="example.com"
record_name="www.example.com"
# MAYBE CHANGE THESE
ip=$(curl -s http://ipv4.icanhazip.com)
@KelvinVenancio
KelvinVenancio / extract.sh
Created October 5, 2017 18:00
função para extrair os mais diversos tipos de arquivos no linux
extrair () {
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) rar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;

Keybase proof

I hereby claim:

  • I am kelvinvenancio on github.
  • I am kelvinsoares (https://keybase.io/kelvinsoares) on keybase.
  • I have a public key whose fingerprint is B5D1 6294 DEFB 0FEA 9EF6 0282 764D 4D2C 4952 8D17

To claim this, I am signing this object:

@KelvinVenancio
KelvinVenancio / create
Last active April 7, 2016 16:10
create vSwap on virtual server
#!/bin/bash
# create vSwap
dd if=/dev/zero of=/swapfile count=2048 bs=1M
chmod 600 /swapfile
ls -lh /swapfile
mkswap /swapfile -f
swapon /swapfile
free -m
echo "adicione a linha abaixo no /etc/fstab"
echo "/swapfile none swap sw 0 0"
@KelvinVenancio
KelvinVenancio / quick_github_commit.sh
Created November 29, 2015 20:01
Quick github commit script.
#!/bin/bash
# Kelvin Soares - [email protected] - kelvinsoares.tk
cd /home/bolado/git/IRCBot
git add .
git status
echo "Do you want to commit ? (y/n)"
read CHOICE
if [ $CHOICE == "y" ]
@KelvinVenancio
KelvinVenancio / verify_dns.sh
Last active November 7, 2015 22:36
Verificação de dns para um domínio, revenda e/ou todas as contas de um servidor. A opção 1, pode ser usada em qualquer distro, as demais (2/3), apenas em servidores/vps com cPanel/CloudLinux.
#!/bin/bash
# Kelvin Soares - [email protected]
clear
tput cup 4 30
echo "Menu Principal - Escolha a opção desejada"
echo ""
menu() {
echo ""
@KelvinVenancio
KelvinVenancio / lamp.sh
Last active November 19, 2020 11:59
Instalação da pilha LAMP + phpMyAdmin com um único script.
#!/bin/bash
# Instalação da pilha LAMP
# Autor: Kelvin Soares - [email protected]
clear
# Variáveis das cores
NC="\E[0;00m";
vermelho="\E[1;31m";
amarelo="\E[1;33m";
verde="\E[1;32m";
@KelvinVenancio
KelvinVenancio / name.php
Last active August 29, 2015 14:20
Consumindo API do Rails com PHP
<?php
$url = "http://localhost:3000/tasks";
$contents = file_get_contents($url);
$contents = utf8_encode($contents);
$results = json_decode($contents, true);
$info = $results;
foreach ($info as $r) {
echo "Nome: $r[name] <br />";