Skip to content

Instantly share code, notes, and snippets.

View viniciusdaniel's full-sized avatar

Vinicius Daniel Antunes Oliveira viniciusdaniel

View GitHub Profile
@viniciusdaniel
viniciusdaniel / scp_tar.sh
Created October 28, 2018 20:25
Best way to copy file across SSH
$ tar czf - <files> | ssh user@host "cd /wherever && tar xvzf -"
@viniciusdaniel
viniciusdaniel / fileBrowserHandler.htm
Created October 22, 2018 17:33 — forked from greenido/fileBrowserHandler.htm
Simple test to FileSystem APIs (HTML5)
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<meta charset=utf-8 />
<title>Chrome File API tester</title>
<script>
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;

How To Route Web Traffic Securely Without a VPN Using a SOCKS Tunnel

PostedJanuary 8, 2016495.7kviewsSECURITYUBUNTU

  • [

    2bead7b7d80a88d147750a6839177311eae3cda7

    Michael Holley

@viniciusdaniel
viniciusdaniel / whiskermenu-1.rc
Created June 11, 2018 22:02
Gist config for whisker menu show recent access for default
favorites=
recent=jetbrains-phpstorm.desktop,google-chrome.desktop,filezilla.desktop,sublime_text.desktop
button-title=Applications Menu
button-icon=xubuntu-logo-menu
button-single-row=false
show-button-title=false
show-button-icon=true
launcher-show-name=true
launcher-show-description=false
item-icon-size=1
@viniciusdaniel
viniciusdaniel / ufw.md
Last active June 4, 2018 11:34
How To Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server

Original source: https://www.digitalocean.com/community/tutorials/how-to-setup-a-firewall-with-ufw-on-an-ubuntu-and-debian-cloud-server

Introduction

One of the first lines of defense in securing your cloud server is a functioning firewall. In the past, this was often done through complicated and arcane utilities. There is a lot of functionality built into these utilities, iptables being the most popular nowadays, but they require a decent effort on behalf of the user to learn and understand them. Firewall rules are not something you want yourself second-guessing.

To this end, UFW is a considerably easier-to-use alternative.

@viniciusdaniel
viniciusdaniel / ufw.html
Created June 4, 2018 11:30
How To Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server
Introduction
<span class="colour" style="color: rgb(0, 0, 0);">One of the first lines of defense in securing your cloud server is a functioning firewall. In the past, this was often done through complicated and arcane utilities. There is a lot of functionality built into these utilities, iptables being the most popular nowadays, but they require a decent effort on behalf of the user to learn and understand them. Firewall rules are not something you want yourself second-guessing.</span>
<span class="colour" style="color: rgb(0, 0, 0);">To this end, UFW is a considerably easier-to-use alternative.</span><br>
<br>
## What is UFW?
<span class="colour" style="color: rgb(0, 0, 0);">UFW, or Uncomplicated Firewall, is a front-end to iptables. Its main goal is to make managing your firewall drop-dead simple and to provide an easy-to-use interface. It’s well-supported and popular in the Linux community—even installed by default in a lot of distros. As such, it’s a great way to get started securing your sever.</span>
var table = "00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 500

Self-Signed SSL Certificates

SSL Overview

As you're likely aware, being able to send data securely over a network (especially a public network) is of growing importance. To that end, many web applicates employ the use of SSL certificates to encrypt traffic between a client (often your web browser) and a server (someone's http server).

If you're interested on learning more about SSL certificates and the various mechanisms (such as "key certificates", "root certificates", "intermediate certificates" and more), jump to about ~51:45 of this edition of Tech Snap.

I really recommend watching that portion of that video. Seriously.

Regular Expression Cheatsheet

Anchors

^   Matches at the start of string or start of line if multi-line mode is
	enabled. Many regex implementations have multi-line mode enabled by
	default.

$ Matches at the end of string or end of line if multi-line mode is enabled.
@viniciusdaniel
viniciusdaniel / Date.prototype.toDateTime.js
Last active May 25, 2017 15:33
Simple datetime timestamp patch for javascript
if (Date.prototype.toDateTime === undefined) {
Date.prototype.toDateTime = function() {
// simple left zero
var lz = function ( v ) { return v < 10 ? '0' + v : '' + v; };
return this.getFullYear() + '/' +
lz( this.getMonth() + 1 ) + '/' +
lz( this.getDate() )+ ' ' +
lz( this.getHours() ) + ":" +