Skip to content

Instantly share code, notes, and snippets.

View profclems's full-sized avatar
🌍
Digital Nomad

Clement Sam profclems

🌍
Digital Nomad
View GitHub Profile
### Keybase proof
I hereby claim:
* I am profclems on github.
* I am profclems (https://keybase.io/profclems) on keybase.
* I have a public key whose fingerprint is 2F9B 07FA E6FC B18C FE5F F274 E661 628E 23FB 5816
To claim this, I am signing this object:
@profclems
profclems / deployUser.md
Created March 24, 2021 03:49 — forked from learncodeacademy/deployUser.md
Adding a deploy user in Linux

(wherever it says url.com, use your server's domain or IP)

Login to new server as root, then add a deploy user

sudo useradd --create-home -s /bin/bash deploy
sudo adduser deploy sudo
sudo passwd deploy

And Update the new password

Take GitLab to the Command Line

This guide features glab, an open-source GitLab CLI tool I maintain.

In this quickstart guide, you’ll learn glab: find out what the tool is used for, how to set it up, and how to use it.

If you’re a GitLab user, you’re obviously aware that you need to switch to the web browser in order to perform various actions like creating issues, merge requests, viewing pipeline logs, etc on your GitLab repository. With the glab, you can execute many of these actions without leaving the command-line interface.

Setting up glab

@profclems
profclems / automate-font-setup.sh
Last active November 4, 2020 05:03
Get emojis working on arch linux with noto-fonts-emoji
#!/bin/sh
set -e
if [[ $(id -u) -ne 0 ]] ; then echo "Please run as root" ; exit 1 ; fi
echo "Setting up Noto Emoji font..."
# 1 - install noto-fonts-emoji package
pacman -S noto-fonts-emoji --needed
# pacman -S powerline-fonts --needed
echo "Recommended system font: inconsolata regular (ttf-inconsolata or powerline-fonts)"
# 2 - add font config to /etc/fonts/conf.d/01-notosans.conf
echo "<?xml version=1.0?>
@profclems
profclems / csv.go
Created August 14, 2020 00:52 — forked from stupidbodo/csv.go
Golang - Read CSV/JSON from URL
package main
import (
"encoding/csv"
"fmt"
"net/http"
)
func readCSVFromUrl(url string) ([][]string, error) {
resp, err := http.Get(url)
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@profclems
profclems / sha256-hmac.md
Created August 4, 2020 03:20 — forked from jasny/sha256-hmac.md
Hashing examples in different languages

Example inputs:

Variable Value
key the shared secret key here
message the message to hash here

Reference outputs for example inputs above:

| Type | Hash |

@profclems
profclems / go-build-all.sh
Created July 26, 2020 03:00 — forked from makew0rld/go-build-all.sh
Cross compile for all possible Golang targets. This script will always be updated, because it uses the `go` command to see what can be built.
#!/usr/bin/env bash
# Based on https://gist.github.com/eduncan911/68775dba9d3c028181e4
# but improved to use the `go` command so it never goes out of date.
type setopt >/dev/null 2>&1
contains() {
# Source: https://stackoverflow.com/a/8063398/7361270
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]]