Skip to content

Instantly share code, notes, and snippets.

View crsuarez's full-sized avatar

Carlos Suarez crsuarez

  • Cali, Colombia
View GitHub Profile
@crsuarez
crsuarez / delete_git_submodule.md
Created January 25, 2023 21:20 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@crsuarez
crsuarez / docker-compose.yml
Created January 13, 2022 20:22 — forked from stevespringett/docker-compose.yml
Dependency-Track sample compose file with PostgreSQL - This doesn't take into account startup/timing to ensure PostgreSQL is ready to accept connections before Dependency-Track startups up.
version: '3'
services:
postgres10:
environment:
- POSTGRES_USER=dtrack
- POSTGRES_PASSWORD=changeme
image: 'postgres:10.5'
volumes:
- './postgres-data:/var/lib/postgresql/data'
dtrack:
@crsuarez
crsuarez / Get-GuidFromMsiFile.ps1
Created May 8, 2020 13:08 — forked from adamrushuk/Get-GuidFromMsiFile.ps1
Getting the Product ID / GUID from MSI file
# Vars
$msiPath = 'C:\Users\arush\Downloads\sqlncli.msi'
# Definition
$sig = @'
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
private static extern UInt32 MsiOpenPackageW(string szPackagePath, out IntPtr hProduct);
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
private static extern uint MsiCloseHandle(IntPtr hAny);
[DllImport("msi.dll", CharSet = CharSet.Unicode, PreserveSig = true, SetLastError = true, ExactSpelling = true)]
@crsuarez
crsuarez / Makefile
Created April 20, 2018 18:09 — forked from isaacs/Makefile
# Hello, and welcome to makefile basics.
#
# You will learn why `make` is so great, and why, despite its "weird" syntax,
# it is actually a highly expressive, efficient, and powerful way to build
# programs.
#
# Once you're done here, go to
# http://www.gnu.org/software/make/manual/make.html
# to learn SOOOO much more.
@crsuarez
crsuarez / install_ruby_1.9.3
Created June 20, 2017 21:15 — forked from slouma2000/install_ruby_1.9.3
Install Ruby 1.9.3 on CentOS, RedHat using RVM
Step 1: Upgrade Packages
# yum update
# yum groupinstall "Development Tools"
Step 2: Installing Recommended Packages
# yum install gcc-c++ patch readline readline-devel zlib zlib-devel
# yum install libyaml-devel libffi-devel openssl-devel make
# yum install bzip2 autoconf automake libtool bison iconv-devel
Step 3: Install RVM ( Ruby Version Manager )
@crsuarez
crsuarez / build-erlang-r16b.sh
Created January 26, 2017 20:47 — forked from bryanhunter/build-erlang-r16b.sh
Build Erlang R16B on Ubuntu
#!/bin/bash
# Pull this file down, make it executable and run it with sudo
# wget https://raw.github.com/gist/5487621/build-erlang-r16b.sh
# chmod u+x build-erlang-r16b.sh
# sudo ./build-erlang-r16b.sh
if [ $(id -u) != "0" ]; then
echo "You must be the superuser to run this script" >&2
exit 1
fi
@crsuarez
crsuarez / vim74_lua
Created January 25, 2017 21:12 — forked from jdewit/vim74_lua
Installing vim 7.4 with lua on Ubuntu 12.04
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
sudo rm -rf /usr/local/share/vim
sudo rm /usr/bin/vim
@crsuarez
crsuarez / gist:5a066638a805e46b448acebd4f5fe8d1
Last active January 14, 2021 05:40 — forked from wacko/gist:5577187
SSH between Mac OS X host and Virtual Box guest

On Mac OS (host):

Shutdown your VM and do:
On a terminal:

VBoxManage hostonlyif create
VBoxManage hostonlyif ipconfig vboxnet0 --ip 192.168.56.1
VBoxManage dhcpserver add --ifname vboxnet0 --ip 192.168.56.1 --netmask 255.255.255.0 --lowerip 192.168.56.100 --upperip 192.168.56.200
VBoxManage dhcpserver modify --ifname vboxnet0 --enable
@crsuarez
crsuarez / bash.generate.random.alphanumeric.string.sh
Created February 16, 2016 01:54 — forked from earthgecko/bash.generate.random.alphanumeric.string.sh
shell/bash generate random alphanumeric string
#!/bin/bash
# bash generate random alphanumeric string
#
# bash generate random 32 character alphanumeric string (upper and lowercase) and
NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
# bash generate random 32 character alphanumeric string (lowercase only)
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1