Skip to content

Instantly share code, notes, and snippets.

View ricardogaspar2's full-sized avatar

Ricardo Gaspar ricardogaspar2

View GitHub Profile
#!/bin/bash
#
# MicroStack by Canonical - Helper Install Script
#
# This script installs the MicroStack snap and setups up the networking fix developed by Rodrigo Nascimento
#
# Original blog post available here: https://connection.rnascimento.com/2021/03/08/openstack-single-node-microstack/
#
# Note: Make sure you adjust the INTERFACE and IP_ADDRESS variables to your environment.
# If you make the IP_ADDRESS the same as your current address you won't lose connection.
@expelledboy
expelledboy / uninstall-nix-osx.sh
Last active November 26, 2023 15:53
Trying Nix
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
@jnovack
jnovack / alfred-4-open-iterm.applescript
Created May 31, 2019 11:14
Alfred 4 Custom Terminal Applescript to Open iTerm
-- Alfred 4 Custom Terminal Script for iTerm
-- To Install, copy to: Alfred --> Features --> Terminal --> Custom
on alfred_script(q)
if application "iTerm2" is running or application "iTerm" is running then
run script "
on run {q}
tell application \"iTerm\"
activate
try
@elalemanyo
elalemanyo / README.md
Last active April 23, 2024 18:25
Debug zsh startup time

Debug zsh startup time

  1. Inject profiling code

    At the beginning of your .zshrc add following: zmodload zsh/zprof

    and at the end add: zprof

    This will load zprof mod and display what your shell was doing durung your initialization.

@juanpampliega
juanpampliega / gist:f7b68c3546d921154ac9eaabf06a8911
Created June 2, 2018 21:46
Install OpenX Hive JSON SerDe in Amazon EMR to use it with Presto
# Do this on every node of the cluster
curl -O http://www.congiu.net/hive-json-serde/1.3.8/hdp23/json-serde-1.3.8-jar-with-dependencies.jar
sudo cp json-serde-1.3.8-jar-with-dependencies.jar /usr/lib/presto/plugin/hive-hadoop2/
sudo chown presto:presto /usr/lib/presto/plugin/hive-hadoop2/json-serde-1.3.8-jar-with-dependencies.jar
#restart presto
sudo restart presto-server
@ido-ran
ido-ran / build.gradle
Created January 24, 2018 13:28
Gradle script migrated from Maven assembly plugin
configurations {
deploymentZip
}
/**
* deployment-conf simply package the files in `content` directory in zip file.
* That zip file is later consumed by other module to build the installers.
*/
task packageZip(type: Zip) {
@sanchezzzhak
sanchezzzhak / clickhouse-get-tables-size.sql
Created January 18, 2018 13:43
clickhouse get tables size
SELECT table,
formatReadableSize(sum(bytes)) as size,
min(min_date) as min_date,
max(max_date) as max_date
FROM system.parts
WHERE active
GROUP BY table
@seangtkelley
seangtkelley / gitkraken-install.sh
Last active October 3, 2019 15:49 — forked from aelkz/[FEDORA] gitkraken
Install Script for Gitkraken on Fedora 27 + Launcher Icon
#!/bin/bash
# Enter /opt folder (common folder for user installed programs)
# This script assumes you have proper permissions on /opt
cd /opt
# Download GitKraken
wget https://release.gitkraken.com/linux/gitkraken-amd64.tar.gz
# Extract the Kraken into /opt directory
@rueycheng
rueycheng / GNU-Make.md
Last active April 29, 2024 01:39
GNU Make cheatsheet
@atao
atao / RunAsAdmin.ps1
Last active October 1, 2023 19:34
🕵️ Self privileges escalation with PowerShell.
#Requires -RunAsAdministrator
#OneLine
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
#Or
$Loc = Get-Location
"Security.Principal.Windows" | % { IEX "( [ $_`Principal ] [$_`Identity ]::GetCurrent() ).IsInRole( 'Administrator' )" } | ? {
$True | % { $Arguments = @('-NoProfile','-ExecutionPolicy Bypass','-NoExit','-File',"`"$($MyInvocation.MyCommand.Path)`"","\`"$Loc\`"");
Start-Process -FilePath PowerShell.exe -Verb RunAs -ArgumentList $Arguments; } }