Skip to content

Instantly share code, notes, and snippets.

@gianv9
gianv9 / nmcli-remove-default-route.txt
Created December 21, 2018 16:14
nmcli remove default route to connection
You can use nmcli to do it, the key is ipv4.never-default:
nmcli connection modify enp3s0 ipv4.never-default true
change enp3s0 with your own connection name.
use false or true to toggle between this config.
Source: https://askubuntu.com/a/913122
check with:
ip route|grep default
@gianv9
gianv9 / create-hotspot.md
Created December 5, 2018 21:44 — forked from narate/create-hotspot.md
Create Wi-Fi Hotspot on Linux using nmcli

Create a Wi-Fi hotspot on Linux using nmcli

Original post : https://unix.stackexchange.com/a/310699

nmcli con add type wifi ifname wlan0 con-name Hostspot autoconnect yes ssid Hostspot
nmcli con modify Hostspot 802-11-wireless.mode ap 802-11-wireless.band bg ipv4.method shared
nmcli con modify Hostspot wifi-sec.key-mgmt wpa-psk
nmcli con modify Hostspot wifi-sec.psk "veryveryhardpassword1234"
@gianv9
gianv9 / gist:c88c75ae5f5f149dc203790707b6f265
Created May 27, 2018 03:15 — forked from szydan/gist:b225749445b3602083ed
<U+FEFF> character showing up in files. How to remove them?
1) In your terminal, open the file using vim:
vim file_name
2) Remove all BOM characters:
:set nobomb
3) Save the file:
:wq
@gianv9
gianv9 / mpi_file_passing.py
Created May 14, 2018 03:39 — forked from brantfaircloth/mpi_file_passing.py
mpi4py "file-passing" scatter/gather example
import os
import tempfile
from mpi4py import MPI
comm = MPI.COMM_WORLD
size = comm.Get_size()
rank = comm.Get_rank()
mode = MPI.MODE_RDONLY
@gianv9
gianv9 / .gitignore
Created April 4, 2018 14:03
DotNetCore Console Application gitignore
# DotNetCore Build folders to be ignored
.vscode/
bin/
obj/
# ignore any folder called cody anywhere
#**/Cody
# ignore any .exe files anywhere
#**/*.exe
@gianv9
gianv9 / README.md
Created March 26, 2018 13:57 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@gianv9
gianv9 / Update .gitignore
Created March 17, 2018 20:28 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."
@gianv9
gianv9 / DataUrlToImage.cs
Created March 15, 2018 14:45 — forked from vbfox/DataUrlToImage.cs
Convert from a DataUrl to an Image in C#
using System;
using System.Drawing;
using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
class Program
{
static string data = @"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAABHNCSVQICAgIfAhkiAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAuhSURBVHic7Zx5kBT1Fcc/r2f2EhZQDq9IvBADiRoGROWaBXcWTCokhaIVb4scRaQUhlJMorCgUiizSoyliWKZMjGR9UghCswSaQVEgQZEJAoiQiJqonJ44B7TL3/0zO7M7Bw7uz0Dhv1WTc30r1+/95vf6/f7vd97r1tUlaMRaklfoB+wRnz69eHqhxytCgBQS7oBU4DuwCPi0x2F7sNRrYAY1JLBwNPRzyzx6ReFkm0UStCRDPHpBmAYMBp4Wy25rFCyC6uANVLONikuqMw2Qnz6ATAC2AAsUkuWqiU98y23cArYJsV2KTMZQFPBZOYI8emXwATgBWAs8LpacnY+ZRZIASIcYpEBD4HahZHZPohPI8BE4HXgDOA1taQyX/IKo4CNLMRgOT7dWRB5HYT49Cvgh8AOHA/pRbXk+rzIyrcXZFtyuyEMZJBekVdBeYBa8h1gI1AKRIDx4tMX3JSRXwvYJDeIMB7lhrzKyRPEp/8EZkUPPcBTaonPTRn5U8Aq6a02t4tNCMekv6mYD6yP/u4CLFFLvu0W8/xNQRtlocJZMkhH5EdA4aCWDAQ2AUXRps3AEPFphz26/FjAOrlQlQmiPNkm+k0ymPVyUV764gLEp28Bj8c1nQcE3eCdFwWoh1nATt7jj1mJN0s/O8Ikhuir+eiLi5gLCXuYmWrJ6R1l6r4CLJkEjFGo5TKNZKRdJz2x+ZMhTHO9Hy5
This was done in gnome 3.26.2, on Arch Linux ( uname -r --> 4.14.15-1-ARCH ).
Run this:
pacman -R evolution-data-server gnome-todo bijiben folks empathy gnome-maps gnome-contacts
@gianv9
gianv9 / gnome-tracker-disable.md
Last active January 28, 2018 00:23 — forked from vancluever/gnome-tracker-disable.md
GNOME Tracker Disable

Disabling GNOME Tracker and Other Info

GNOME's tracker is a CPU and privacy hog. There's a pretty good case as to why it's neither useful nor necessary here: http://lduros.net/posts/tracker-sucks-thanks-tracker/

After discovering it chowing 2 cores, I decided to go about disabling it.

Directories