Skip to content

Instantly share code, notes, and snippets.

View dikiaap's full-sized avatar

Diki Ananta dikiaap

View GitHub Profile
@dikiaap
dikiaap / git-io-custom-url.md
Last active December 5, 2024 06:42
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
@dikiaap
dikiaap / command-line-cheatsheet.md
Last active June 6, 2022 05:21
Command Line Cheatsheet

dotfiles ❤ ~/

dikiaap/dotfiles

Linux

  • Disable packages on Debian-based distro
    • sudo apt-mark hold package-name
  • Print the build date of Linux kernel using ISO 8601 format
    • uname -v | awk '{print $6,$5,$4,$8,$7;}' | xargs -I{} date -d "{}" "+%Y-%m-%d"
  • Remove config files
  • dpkg --list | grep '^rc' | awk '{ print $2 }' | xargs sudo apt-get purge
@dikiaap
dikiaap / xkcd-dl
Last active June 4, 2021 16:20
Bash script to download xkcd comics
#!/usr/bin/env bash
# Print usage message.
usage() {
local program_name
program_name=${0##*/}
cat <<EOF
Usage: $program_name [-option]
Options:
-h Print this message
@dikiaap
dikiaap / erase_all_jobs.sh
Created March 6, 2019 01:47 — forked from btgoodwin/erase_all_jobs.sh
GitLab EE/CE V4 API: Erase all jobs for project
#!/usr/bin/env bash
# Author: Thomas Goodwin
# Company: Geon Technologies
# Purpose: Erase all jobs for a given GitLab project.
# Arguments:
# 1) URL of gitlab project (https://some.server.com/group/[group/]project)
# 2) private token (personal access token, impersonation token, etc.)
#
# Requirements: bash > 4.0, jq