Skip to content

Instantly share code, notes, and snippets.

View efindus's full-sized avatar
🔥
On fire

efindus

🔥
On fire
View GitHub Profile
@CMCDragonkai
CMCDragonkai / reload_dns_cache_network_manager.md
Created June 19, 2022 06:39
Reload the DNS Cache in Network Manager

Reload the DNS Cache in Network Manager

You may be using NetworkManager with dnsmasq as the DNS plugin. If so, it's being used as a local caching nameserver.

When its data is outdated, you can force it to reload its DNS cache with:

Use:

nmcli general reload dns-full
@RobertAKARobin
RobertAKARobin / python.md
Last active June 13, 2024 04:24
Python Is Not A Great Programming Language
@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,