Skip to content

Instantly share code, notes, and snippets.

View rkalit's full-sized avatar
🏡
Working from home

Ruli Simanungkalit rkalit

🏡
Working from home
  • Indonesia
View GitHub Profile
@rkalit
rkalit / roundRobin.py
Created February 7, 2022 18:03
DKatalis Solution for Q2
def t1Resource(x):
existCheckt1 = resource.count(x)
if existCheckt1 > 0:
T1.append(x)
resource.remove(x)
else:
res = min(resource)
T1.append(res)
resource.remove(res)
def build_status = false
def test_status = false
pipeline {
agent {
node {
label 'jslave'
}
}
environment {
@rkalit
rkalit / getbranch.sh
Created October 13, 2021 09:30
A script to get all remote branch to your local, put this script on your `/usr/local/bin`
#!/bin/bash
workdir=$(pwd)
tempFile=$HOME/temp.txt
cd ${workdir}
git branch -a | grep 'origin' | grep -v 'HEAD' | cut -d "/" -f3 -f4 > ${tempFile}
for branch in `cat ${tempFile}`;
do
git checkout ${branch}
#!/bin/bash
#--------------- Initial Variables ---------------#
flagPos="$(cat /home/$USER/.record)"
flagName="testflag.txt"
# flag="${flagPos}${flagName}"
userCommandHistory="/home/$USER/.bash_history"
fileDestination="$(shuf -n 1 /home/$USER/directory)"
#------------- End of Init Variables -------------#
@rkalit
rkalit / MathSolver.py
Created July 11, 2020 23:33
Use to Solve MathSolver KKSI 2019
from pwn import *
r = remote('192.168.3.100',6699)
for i in range(1,11):
r.recvuntil('No: (%d) ' % i)
calc = r.recvuntil('=>', drop=True)
print ('%d %s' % (i , str(eval(calc))))
r.send(str(eval(calc)) + '\n')
#!usr/bin/python
def countBits(n, carry):
binNum = []
car0 = 0
car1 = 0
def decToBin(n):
while(n>0):
if n % 2 == 0:
@rkalit
rkalit / pipelineExample.groovy
Created July 25, 2019 07:47
example of my pipeline
def buildStatus = false
def testStatus = false
pipeline {
agent any
stages {
stage('Checkout branch') {
parallel {
stage('Checkout branch') {
steps {
@rkalit
rkalit / testJenkinsfile.groovy
Last active July 19, 2019 04:11
Jenkinsfile Test to ask input from user
def didTimeout = false
def abortStatus = false
pipeline {
agent any
stages {
stage ('Deploy Application') {
steps {
script {
@rkalit
rkalit / Go_SimpleConsoleApp.go
Last active December 26, 2023 01:13
A simple console App that can do simple CRUD (Create Read Update Delete) written in Go language
/*
Code by rkalit
*/
package main
import(
"fmt"
"bufio"
"os"
)