Skip to content

Instantly share code, notes, and snippets.

View rustoceans's full-sized avatar

Rust Oceans rustoceans

  • Milano - IT
View GitHub Profile
#!/bin/bash
set -euo pipefail
echo "-------------------------------------------"
echo "------ forking our repositories --------"
echo "-------------------------------------------"
links=(
"git@github.com:luizalabs/cain.git"
@rustoceans
rustoceans / update-nightly.sh
Created November 17, 2017 15:43
update nightly
rm -rf ~/firefox-59.0a1.en-US.linux-x86_64.tar.bz2
nightly_url="https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central/firefox-59.0a1.en-US.linux-x86_64.tar.bz2"
wget $nightly_url
cd /opt
sudo rm -rf firefox/
sudo tar -xvjf ~/firefox-59.0a1.en-US.linux-x86_64.tar.bz2
@rustoceans
rustoceans / update-nightly.sh
Created November 15, 2017 19:47
update nightly
nightly_url="https://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-central/firefox-59.0a1.en-US.linux-x86_64.tar.bz2"
wget $nightly_url
cd /opt
sudo rm -rf firefox/
sudo tar -xvjf ~/firefox-59.0a1.en-US.linux-x86_64.tar.bz2
@rustoceans
rustoceans / dracula.vim
Created October 23, 2017 04:23
dracula theme customized
" Dracula Theme v1.2.7
"
" https://github.com/zenorocha/dracula-theme
"
" Copyright 2016, All rights reserved
"
" Code licensed under the MIT license
" http://zenorocha.mit-license.org
"
" @author Trevor Heins <@heinst>
@rustoceans
rustoceans / .bash_prompt
Last active January 19, 2018 11:18
my bash prompt
#!/bin/bash
source "$(dirname $(readlink $BASH_SOURCE))/../os/utils.sh"
# ----------------------------------------------------------------------
# | Colors |
# ----------------------------------------------------------------------
enable_color_support() {
def install_and_import(package):
import importlib
try:
importlib.import_module(package)
except ImportError:
import pip
pip.main(['install', package])
finally:
globals()[package] = importlib.import_module(package)
#!/bin/bash
sudo rm /tmp/update.txt; tput setaf 6; echo "Initializing.. Please Wait"
sudo apt-get update >> /tmp/update.txt 2>&1; awk '( /W:/ && /launchpad/ && /404/ ) { print substr($5,26) }' /tmp/update.txt > /tmp/awk.txt; awk -F '/' '{ print $1"/"$2 }' /tmp/awk.txt > /tmp/awk1.txt; sort -u /tmp/awk1.txt > /tmp/awk2.txt
tput sgr0
if [ -s /tmp/awk2.txt ]
then
tput setaf 1
printf "PPA's going to be removed\n%s\n" "$(cat /tmp/awk2.txt)"
tput sgr0
while read -r line; do echo "sudo add-apt-repository -r ppa:$line"; done < /tmp/awk2.txt > out
@rustoceans
rustoceans / README-Template.md
Created October 5, 2017 05:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@rustoceans
rustoceans / flash-app.js
Created October 5, 2017 05:21 — forked from brianmacarthur/flash-app.js
Flash messaging in Express 4: express-flash vs. custom middleware in ejs, handlebars, or jade
var express = require('express');
var cookieParser = require('cookie-parser');
var session = require('express-session');
var flash = require('express-flash');
var handlebars = require('express-handlebars')
var app = express();
var sessionStore = new session.MemoryStore;
// View Engines
@rustoceans
rustoceans / gist:ca2cdc9d4500d604dfb3ec269fe2834d
Last active October 5, 2017 02:12 — forked from mrtns/gist:78d15e3263b2f6a231fe
Upgrade Chrome from Command Line on Ubuntu
# Install
# via http://askubuntu.com/questions/510056/how-to-install-google-chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
# Update