Skip to content

Instantly share code, notes, and snippets.

View viniciusfeitosa's full-sized avatar

Vinicius Feitosa Pacheco viniciusfeitosa

View GitHub Profile
@viniciusfeitosa
viniciusfeitosa / gist:07bf4984a844037ab22d35c974b3918d
Created July 9, 2018 18:17 — forked from Rambou/gist:c6769caee19b0b9915d8342b86c3ef72
Installing Nvidia propreatary drivers in Linux with UEFI enabled
If, like me, your are booting with UEFI (because having a triple boot ubuntu-windows-mac or because UEFI is the most modern type of bootloader and successor of EFI :p), you have to sign the proprietary modules each time they are recompiled (or upgrade kernel version) so that they are allowed to be loaded in the kernel.
1) Step one, create a self-signed certificate to sign nvidia driver:
sudo openssl req -new -x509 -newkey rsa:2048 -keyout UEFI.key -outform DER -out UEFI.der -nodes -days 36500 -subj "/CN=rambou_nvidia/"
2) step two load and store certificate in a supplementary key database MOC
sudo mokutil --import UEFI.der
3) step three reboot your system
At this step after reboot you will be prompted to select your certificate to import in in key database. If you have inserted a password at certificate creation you'll be prompted to insert it. If you are not prompted, you may have to enter the BIOS by using function keys at boot time.
@viniciusfeitosa
viniciusfeitosa / docker-cleanup-resources.md
Created October 21, 2017 20:37 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

{
"snippets": [
{
"match": {"global": true, "pkgname": ".", "fn": ".*_test.go"},
"snippets": [
{"text": "func Test", "title": "", "value": "func Test${1:ObjectName}${2:TestName}(t *testing.T) {\n\t$0\n}"},
{"text": "func Benchmark", "title": "", "value": "func Benchmark${1:ObjectName}${2:BenchmarkName}(b *testing.B) {\n\n\tb.StopTimer()\n\n\t$0\n\n\tb.StartTimer()\n\n\tfor i := 0; i < b.N; i++ {\n\t\t\n\t}\n\n}"},
{"text": "func Example", "title": "", "value": "func Example${1:ObjectName}${2:ExampleName}() {\n\n\t$0\n\n\t// Output:\n\t// \n\n}"}
]
}
@viniciusfeitosa
viniciusfeitosa / gist:4713852
Created February 5, 2013 11:26
Desafio 2 WDEV
package com.viniciusfeitosa.desafio2;
import java.util.Scanner;
public class TesteDesafio {
public static void main(String[] args) {
try {
@viniciusfeitosa
viniciusfeitosa / gist:4711188
Last active December 12, 2015 03:59
Desafio 1 WDEV
package com.viniciusfeitosa.desafio1;
import java.util.HashMap;
import java.util.Scanner;
public class TesteDesafio {
public static void main(String[] args) {