Skip to content

Instantly share code, notes, and snippets.

View rosdyana's full-sized avatar
💭
I may be slow to respond.

Rosdyana Kusuma rosdyana

💭
I may be slow to respond.
View GitHub Profile
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
#
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
#!/bin/bash
less -r $1 | env ansi2html.pl $3 > $2
#!/bin/bash
if [ "$(whoami)" != "root" ]; then
echo "Sorry, you are not root."
exit 1
fi
echo "Stop all dokku--- Begin -->"
sudo dokku ps:stopall
echo "Stop all dokku--- End --/>"
@rosdyana
rosdyana / guess_code.py
Created February 23, 2019 16:57
mini game with python
import random
def set_user_guess():
return input("What is your guess ? ")
def generate_secret():
secret_code = [str(num) for num in range(10)]
random.shuffle(secret_code)
@rosdyana
rosdyana / Update-branch.md
Created January 9, 2019 08:20 — forked from santisbon/Update-branch.md
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything looks good the branch can be merged. Otherwise, you can deploy your master branch to return production to its stable state.

Updating a feature branch

First we'll update your local master branch. Go to your local project and check out the branch you want to merge into (your local master branch)

$ git checkout master

Fetch the remote, bringing the branches and their commits from the remote repository. You can use the -p, --prune option to delete any remote-tracking references that no longer exist in the remote. Commits to master will be stored in a local branch, remotes/origin/master

@rosdyana
rosdyana / androidbash.sh
Last active December 18, 2018 10:33
[ANDROID] Build & Install CLI
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
# ANDROID PART #
alias launchEmulator="$ANDROID_HOME/emulator/emulator -avd Nexus_5_API_27"
alias aapt="$ANDROID_HOME/build-tools/28.0.3/aapt"
## install apk to device
alias apkinstall="adb devices | tail -n +2 | cut -sf 1 | xargs -I X adb -s X install -r $1"
#include <stdio.h>
#include <string>
#include <stdexcept>
#include <iostream>
class Palindrome{
public:
static bool isPalindrome(const std::string &word){
int stringLength=word.length();
for(int i=0; i<stringLength; i++){
  1. Untuk bidang Web hacking: Apa perbedaan antara cross site scripting (XSS) dan cross site request forgery (CSRF). Berikan juga contoh tekniknya masing masing, sekaligus cara mencegahnya (countermeasures).
  • Answer :
  • XSS ( Cross-Site Scripting ), salah satu jenis serangan pada aplikasi web yang memanfaatkan celah pada validasi input di sisi user/client. XSS umumnya sering diremehkan padahal celah ini bisa berakibat fata. Pada dasarnya, teknik yang digunakan cukup mudah, attacker dapat menggungakan social engineering pada korban agar mengakses tautan yang telah disisipi xss code. Yang mana nantinya jika hal ini berhasil, attacker dapat mencuri beberapa informasi penting dari korban melalui cookie, session, atau informasi lainnya yang tersimpan pada client-side. Berbeda denga phising yang menggunakan fake website, korban xss percaya bahwa tautan yang diakses adalah real website. Kasus xss yang saya ingat adalah pada salah satu bank di Indonesia, attacker menemukan celah xss pada notifikasi login fail

Imsakiyah Ramadhan 1439 H (2018)

Taoyuan, Taoyuan District, Taoyuan City, Republik Tiongkok

Koordinat: (24.99, 121.32). Zona Waktu: Asia/Taipei. Arah Kiblat: 286° dari Utara.

import os
import sys
import re
import json
# input dir of images
path = sys.argv[1]
# output json file
outfile = sys.argv[2]