Skip to content

Instantly share code, notes, and snippets.

View sshaplygin's full-sized avatar
🎯
Focusing

Sam Shaplygin sshaplygin

🎯
Focusing
  • Belgrade, Republic of Serbia
  • 07:27 (UTC +01:00)
  • X @sshaplygin
View GitHub Profile
@sidmulajkar
sidmulajkar / wireguard-issue-connecting.md
Created October 10, 2022 18:18
/usr/bin/wg-quick: line 32: resolvconf: command not found

/usr/bin/wg-quick: line 32: resolvconf: command not found

This issue is caused while using the Wireguard in Ubuntu as the installation doesn't come with resolvconf or openresolv

Problem

sid@sid:~$ sudo wg-quick up /etc/wireguard/abc.conf
[sudo] password for sid: 
[#] ip link add abc type wireguard
[#] wg setconf abc /dev/fd/63
@kulti
kulti / .golangci.yml
Last active June 25, 2024 23:44
golangci-lint config workflow
# Comments started with [!] are explanations of my workflow with golangci-lint.
# Another comments are real comments in my config.
# [!] Examine the https://golangci-lint.run/usage/configuration/ to know all possibilities.
run:
timeout: 5m
modules-download-mode: vendor # [!] if you are using vendoring
build-tags:
- integration # [!] If you disable code for integration tests to run all unit tests, enable it to lint all the same.
@aperture147
aperture147 / ffmpeg.go
Last active November 13, 2024 16:30
fix make buffer
package main
import (
"bytes"
"io/ioutil"
"log"
"os"
"os/exec"
)
@pavankjadda
pavankjadda / How to fix gitignore not working issue.md
Last active November 14, 2024 18:12
How to fix "gitignore not working" issue

FYI: Created blog post with more details

How to fix ".gitignore not working" issue?

Sometimes git does not exclude files/folders added .gitignore especially if you had commited them before. Here is how to fix it. I am ignoring node_modules from Angular project as an example

  1. Update .gitignore with the folder/file name you want to ignore. You can use anyone of the formats mentioned below (prefer format1)
### Format1  ###
node_modules/
@salmoni
salmoni / goQueryTest.go
Last active October 13, 2024 12:20
Parsing HTML in Go/Golang using goQuery to extract data from only one of multiple tables. Demonstrates nested Find statements.
package main
import (
"fmt"
"log"
"strings"
"github.com/PuerkitoBio/goquery"
)
@robhrt7
robhrt7 / MySQL_5-7_macOS.md
Last active November 4, 2024 19:55 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL 5.7 on macOS using Homebrew

This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).

Install MySQL 5.7 on macOS

This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.
@alejandro-martin
alejandro-martin / multiple-ssh-keys-git.adoc
Last active November 13, 2024 05:54
Configure multiple SSH Keys for Git

Use Multiple SSH Keys for Git host websites (Github, Gitlab)

This is guide about how to configure multiple SSH keys for some Git host websites such as Github, Gitlab, among others.

Creating SSH keys

  1. Create SSH directory:

@tallclair
tallclair / git-repo-demo.yaml
Created March 9, 2018 19:54
More secure GitRepo volumes
# Example of using an InitContainer in place of a GitRepo volume.
# Unilke GitRepo volumes, this approach runs the git command in a container,
# with the associated hardening.
apiVersion: v1
kind: Pod
metadata:
name: git-repo-demo
annotations:
seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
spec:
@xeoncross
xeoncross / channels.go
Created February 12, 2018 22:39
Fastest way to merge multiple channels in golang.
package main
import (
"fmt"
"sync"
"sync/atomic"
)
// Fill Channel with int values
func fillChan(number int) <-chan int {
@ZenGround0
ZenGround0 / client.go
Created January 3, 2018 20:26
Golang HTTP multipart streaming
package main
import (
"io"
"mime/multipart"
"net/http"
"net/url"
"os"
"fmt"
)