Skip to content

Instantly share code, notes, and snippets.

View RenatoXSR's full-sized avatar

Renato Rosa RenatoXSR

View GitHub Profile
@damphat
damphat / apt-rdepends-tree
Last active July 6, 2024 07:46
debian dependency tree
#! /bin/bash
# Description: show dependency tree
# Author: damphat
if [ $# != 1 ]; then
echo 'Usage: apt-rdepends-tree <package>'
echo 'Required packages: apt-rdepends'
exit 1
fi
@larrybolt
larrybolt / cf-ddns.sh
Last active June 16, 2024 19:06
Automatically update your CloudFlare DNS record to the IP, Dynamic DNS for Cloudflare
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Automatically update your CloudFlare DNS record to the IP, Dynamic DNS
# Can retrieve cloudflare Domain id and list zone's, because, lazy
# Place at:
# /usr/local/bin/cf-ddns.sh
@alfo
alfo / cron.php
Created January 14, 2014 17:48
Cron job to update Cloudflare's DNS to point to your current IP address. Useful for people with dynamic public IPs because their stupid ISP won't let them have a static one.
<?php
// Grab the IP address
// This is the fastest method I've found so far
$ip = system('dig +short myip.opendns.com @resolver1.opendns.com');
// For cron logs
print "New IP is: " . $ip;
$ch = curl_init();
@sergiopvilar
sergiopvilar / valorPorExtenso.js
Last active November 23, 2023 13:18
Transcrição de valores por extenso em Javascript
// Define as partes do valor por extenso
var extenso = [];
extenso[1] = 'um';
extenso[2] = 'dois';
extenso[3] = 'tres';
extenso[4] = 'quatro';
extenso[5] = 'cinco';
extenso[6] = 'seis';
extenso[7] = 'sete';
@claws
claws / mqtt-ws-proxy
Created February 3, 2014 23:39
Simple WebSockets Proxy for a MQTT broker
# This gist demonstrates a simple method to create a WebSockets proxy for a MQTT broker.
# I use this method to provide a WebSockets interface for the Mosquitto MQTT broker.
# This lets my browser based MQTT applications to access my MQTT broker.
# I consider this approach simpler than the common alternative which is to run lighttpd
# with the mod_websocket addon which can be complex to setup.
#
# Dependencies are Python, Twisted and Autobahn.
#
# This example sets up a WebSockets server listening on localhost:9000. Messages received from
# WebSocket clients are forwarded to the MQTT broker using the endpointforward plugin provided
@mcxiaoke
mcxiaoke / nginx-gitweb.md
Created January 18, 2016 02:54
Set up Gitweb + Nginx from scratch on Debian Wheezy

This guide offers the least time-consuming way of setting up Nginx for serving Git repositories over HTTP using Gitweb. The stuff here has been tested with Git 1.9.1 and Nginx 1.6.0 on Debian Wheezy. Probably also works for Ubuntu, etc.

Total time ~ 10 minutes.

Install

Enable wheezy-backports by adding this line to /etc/apt/sources.list:

deb http://http.debian.net/debian wheezy-backports main
##
## How to install mcrypt in php7.2 / php7.3
## Linux / MacOS / OSX
##
## https://lukasmestan.com/install-mcrypt-extension-in-php7-2/
#