Skip to content

Instantly share code, notes, and snippets.

Avatar

Diki Ananta dikiaap

View GitHub Profile
@dikiaap
dikiaap / xkcd-dl
Last active Jun 4, 2021
Bash script to download xkcd comics
View xkcd-dl
#!/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 Mar 6, 2019 — forked from btgoodwin/erase_all_jobs.sh
GitLab EE/CE V4 API: Erase all jobs for project
View erase_all_jobs.sh
#!/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
View git-io-custom-url.md

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 Jun 6, 2022
Command Line Cheatsheet
View command-line-cheatsheet.md

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