Skip to content

Instantly share code, notes, and snippets.

View sebastiandg7's full-sized avatar
🌊

Sebastian Duque Gutierrez sebastiandg7

🌊
View GitHub Profile
@sebastiandg7
sebastiandg7 / insert_all_countries.sql
Created October 25, 2017 19:20
Insert all countries to databse (name and code).
USE `database`;
CREATE TABLE `country` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`code` VARCHAR(45) NOT NULL,
PRIMARY KEY (`id`)
)
INSERT INTO `country` (`id`, `name`, `code`) VALUES (null, 'Afghanistan','AF');
@sebastiandg7
sebastiandg7 / insert_all_timezones.sql
Last active October 16, 2018 17:50
Insert all timezones to database (name and UTC offset).
USE `database`;
CREATE TABLE `timezone` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(45) NOT NULL,
`offset` VARCHAR(10) NOT NULL,
`raw_offset` INT NOT NULL,
PRIMARY KEY (`id`)
)
@sebastiandg7
sebastiandg7 / Postman.desktop
Created December 5, 2017 02:15 — forked from aviskase/Postman.desktop
Install Postman
[Desktop Entry]
Encoding=UTF-8
Name=Postman
Exec=postman
Icon=/opt/Postman/resources/app/assets/icon.png
Terminal=false
Type=Application
Categories=Development;
@sebastiandg7
sebastiandg7 / OpenVPN-Dockerfile
Created January 24, 2018 02:03
Dockerfile for the creation of an OpenVPN container
FROM ubuntu:16.04
# VARS
ENV KEY_COUNTRY CO
ENV KEY_PROVINCE VALLE
ENV KEY_CITY CALI
ENV KEY_ORG MyOrganization
ENV KEY_EMAIL email@example.com
ENV KEY_OU Community
@sebastiandg7
sebastiandg7 / script.service.ts
Created June 21, 2018 20:27
Angular: dynamically load local or URL hosted JS scripts
import { Injectable } from "@angular/core";
import { ScriptStore } from "./script.store";
declare var document: any;
@Injectable()
export class ScriptService {
private scripts: any = {};
@sebastiandg7
sebastiandg7 / postman-deb.sh
Created July 12, 2018 17:10 — forked from SanderTheDragon/postman-deb.sh
A shellscript to create a Postman .deb file, for simple installation on Debian-based Linux distro's. Also creates a .desktop file.
#!/bin/sh
script=`basename "$0"`
if [ $# -gt 0 ] && [ "$1" = "-e" ]; then
e="-e"
fi
echo "Removing old Postman tarballs"
rm -f $(ls Postman*.tar.gz)
@sebastiandg7
sebastiandg7 / cockroach-cluster-docker-compose.yml
Last active August 15, 2018 14:30
CockroachDB cluster with two datacenters simulation using docker compose
# CockroachDB cluster with two datacenters simulation using docker compose
version: '2'
networks:
shared-roachnet:
driver: bridge
dc0-roachnet:
driver: bridge
dc1-roachnet:
@sebastiandg7
sebastiandg7 / delete_duplicates.bash
Created August 30, 2018 17:46
Delete duplicated files in linux
#!/bin/bash
declare -A arr
shopt -s globstar
for file in **; do
[[ -f "$file" ]] || continue
read cksm _ < <(md5sum "$file")
if ((arr[$cksm]++)); then
echo "rm $file"
@sebastiandg7
sebastiandg7 / npm
Last active January 15, 2019 23:58
npm script fix for Windows shared node installation with WSL
#!/bin/sh
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix
basedir=`dirname "$0"`
case `uname` in
*CYGWIN*) basedir=`cygpath -w "$basedir"`;;
esac
if grep -iq 'Microsoft\|WSL' /proc/version; then
@sebastiandg7
sebastiandg7 / ei.cfg
Last active April 20, 2024 11:37
Config file to place in sources/ei.cfg inside Windows Installation USB to avoid automatic Windows version detection
[EditionID]
Professional
[Channel]
Retail