Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis
cellularmitosis / README.md
Last active April 26, 2024 06:45
Quick-n-dirty QEMU script to spin up Debian on various CPU's
@iAnatoly
iAnatoly / base64
Created August 4, 2016 17:55
One-liners encoding and decoding Base64 in powershell
[System.Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("SecretMessage"))
[System.Text.Encoding]::UTF8.GetString([System.Convert]::FromBase64String("U2VjcmV0TWVzc2FnZQ=="))
@sgergely
sgergely / gist:3793166
Created September 27, 2012 09:43
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@guweigang
guweigang / git_toturial
Last active April 26, 2024 06:41
git命令大全
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git config --global --unset http.proxy # remove proxy configuration on git
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
@Brainiarc7
Brainiarc7 / refind-setup.md
Last active April 26, 2024 06:39
Setting up rEFInd on Ubuntu 16.04 LTS for multi-boot purposes with secure boot enabled.

Deploying rEFInd on Ubuntu 16.04 LTS with secure boot enabled

Hello guys,

For these dual-booting Ubuntu 16.04 with an alternate operating system in UEFI boot mode, it may often be necessary to use a third-party boot manager such as rEFInd, as it's significantly superior to grub2's on UEFI-capable systems.

This write-up assumes that:

(a). The user is running a current Ubuntu 16.04LTS operating system installation (preferably on a dual-boot system)

@zapisnicar
zapisnicar / telegram_bot.md
Last active April 26, 2024 06:38
How to create Telegram bot and send messages to group

How to create Telegram Bot and send messages to your group

  1. Create Telegram bot:

    Search for user @BotFather in Telegram app. Type /help in BotFather chat and wait for the reply. Type in the chat:

    /newbot

or select /newbot command from Help text. Answer few setup questions:

@mietzen
mietzen / macos-bitwarden-cli-with-touch-id.md
Last active April 26, 2024 06:37
How to use use Bitwarden CLI with macOS Touch ID

How to use Bitwarden CLI with macOS Touch ID

If you want to use Bitwarden CLI for ssh have a look at: How to use use Bitwarden CLI for SSH-Keys in macOS

Wirtten and tested on macOS Ventura

Configure Touch ID for the sudo command

To allow Touch ID on your Mac to authenticate you for sudo access instead of a password you need to do the following.

@insidegui
insidegui / ScrollViewOffsetModifier.swift
Created July 20, 2021 20:28
A SwiftUI ViewModifier that can be used to read a ScrollView's offset and store it into a @State property of the view
struct ScrollViewOffsetPreferenceKey: PreferenceKey {
static var defaultValue: CGPoint = .zero
static func reduce(value: inout CGPoint, nextValue: () -> CGPoint) {
value = nextValue()
print("value = \(value)")
}
typealias Value = CGPoint
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 26, 2024 06:32
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.