Skip to content

Instantly share code, notes, and snippets.

View brunodrugowick's full-sized avatar
🐢
Focusing

Bruno Drugowick Muniz brunodrugowick

🐢
Focusing
View GitHub Profile
@brunodrugowick
brunodrugowick / snap-fix-after-upgrade.sh
Created December 27, 2021 14:30
Snaps got disconnected (?) after Ubuntu upgrade (18.04 to 20.04). This fixes them.
#!/bin/bash
# Thanks to: https://gitlab.com/Aviksaikat/snap_fix_kali_debian
# Snaps got disconnected (?) after Ubuntu upgrade. This fixes them.
# Lists all snaps
# Cut to get their names (first field)
# Tail to ignore first line
# While there's a new line, disable that snap then enable it
snap list | cut -d ' ' -f1 | tail -n +2 | while read line; do sudo snap disable $line && sudo snap enable $line; done
@brunodrugowick
brunodrugowick / postgres.sh
Created September 11, 2019 02:35
Script for postgres docker for development
#!/bin/bash
start() {
sudo docker run --rm --name postgres -e POSTGRES_PASSWORD=postgres -d -p 5432:5432 -v /home/drugo/docker/volumes/postgres:/var/lib/postgresql/data postgres
return 0
}
stop() {
sudo docker stop postgres
return 0
@brunodrugowick
brunodrugowick / mysql.sh
Created September 11, 2019 02:34
Script for mysql docker for development
#!/bin/bash
start() {
sudo docker run --rm --name mysql -p 4406:3306 -v /home/drugo/docker/volumes/mysql:/var/lib/mysql -e MYSQL_ROOT_PASSWORD=mysql -e MYSQL_DATABASE=mysql -e MYSQL_USER=mysql -e MYSQL_PASSWORD=mysql -d mysql
echo "MySQL docker instance exposed on local port 4406"
return 0
}
stop() {
sudo docker stop mysql
@brunodrugowick
brunodrugowick / Solution.java
Last active April 20, 2019 02:26
A solution to Beautiful Days (hackerrank) in Java 8
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
@brunodrugowick
brunodrugowick / Solution.java
Last active April 19, 2019 21:18
A solution to Angy Professor (hackerrank) in Java 8
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {
@brunodrugowick
brunodrugowick / Solution.java
Created April 18, 2019 05:53
A solution to Utopian Tree (hackerrank) in Java 8
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Solution {