Skip to content

Instantly share code, notes, and snippets.

@mahirrudin
mahirrudin / config.json
Created October 20, 2020 08:22
Karabiner Element for Motospeed CK62 on Mac
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": true
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@mahirrudin
mahirrudin / personal_access_token.py
Created March 10, 2020 02:58 — forked from vitalyisaev2/personal_access_token.py
Script for obtaining Gitlab API Personal Access Token
#!/usr/bin/python3
"""
Script that creates Personal Access Token for Gitlab API;
Tested with:
- GitLab Community Edition 10.1.4
- Gitlab Enterprise Edition 12.6.2
"""
import sys
import requests
from urllib.parse import urljoin
@mahirrudin
mahirrudin / personal_access_token.go
Created March 10, 2020 02:58 — forked from liu316484231/personal_access_token.go
Golang Script for obtaining Gitlab API Personal Access Token
/**
* Created by bing at 2019-12-17 08:58
*/
package rscrawler
import (
"github.com/anaskhan96/soup"
"io/ioutil"
"log"
"net/http"
@mahirrudin
mahirrudin / gitlab-ci-pipeline-clean.sh
Last active January 9, 2020 22:14
Shell script for cleaning gitlab
#!/usr/bin/env sh
read -p 'GITLAB-CI-TOKEN: ' token
read -p 'GITLAB-PROJECT-ID: ' projectid
read -p 'PIPELINE-ID-FIRST: ' firtspipeline
read -p 'PIPELINE-ID-LAST: ' lastpipeline
for i in {$firtspipeline..$lastpipeline}; do `curl -k --header "PRIVATE-TOKEN: $token" --request "DELETE" https://gitlab.devsecops.lab/api/v4/projects/$projectid/pipelines/$i`; done

Keybase proof

I hereby claim:

  • I am mahirrudin on github.
  • I am mhrdn (https://keybase.io/mhrdn) on keybase.
  • I have a public key ASCaiN6ZLUH_VOlw2BOD-9wDOOG-ohsE1HwtruyLcu6pqwo

To claim this, I am signing this object:

@mahirrudin
mahirrudin / cleanfiles.sh
Created June 18, 2018 13:56
Delete courier mailbox files than 90 days
#!/bin/bash
TODAY=$(date)
HOST=$(hostname)
echo "-----------------------------------------------------"
echo "Date: $TODAY"
echo "Host:$HOST"
echo "-----------------------------------------------------"
echo ""
diskbefore="`df -h / | awk '{ print $4 }' | tail -n 1| cut -d'%' -f1`"
@mahirrudin
mahirrudin / ubuntu-bionic-openldap-mysql.sh
Created June 17, 2018 15:12
OpenLDAP with MySQL Backend - Ubuntu 18.04
## installation openldap with backend mysql
sudo apt update && sudo apt upgrade -y && sudo reboot
sudo apt install mysql-server unixodbc make gcc libmysqlclient-dev unixodbc-dev groff ldap-utils
## mysql login as root
sudo mysql -u root
CREATE DATABASE ldap
CREATE USER 'ldap'@'%' IDENTIFIED BY 'S3cureP4ssw0rd$';
GRANT ALL PRIVILEGES ON ldap.* TO 'ldap'@'%';
@mahirrudin
mahirrudin / ConvTemp.java
Last active August 29, 2015 14:11
Java CLI - Conversion Temperature
import javax.swing.*;
public class KonversiTemperatur {
public static void main(String[] args) {
double tempC, tempR, tempF;
String bilangan = JOptionPane.showInputDialog("Masukkan Celcius : ");
System.out.println("Masukkan angka : " + bilangan);
tempC = Double.parseDouble(bilangan);
tempR = tempC*4/5;
tempF = tempC*9/5+32.0;
System.out.println("Temperature Celcius = " + tempC );