Skip to content

Instantly share code, notes, and snippets.

View justudin's full-sized avatar

Muhammad Syafrudin justudin

View GitHub Profile
import java.util.Scanner;
// main class DesToBin
public class DesToBin {
public static void main(String[] args) {
// TODO Auto-generated method stub
int des, a;
Konversi angka = new Konversi();
//get input from user
import java.io.*;
public class BinaryToDecimal {
public static void main(String[] args) {
//get the input data from user
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Masukan Bilangan Binernya: ");
String str = null;
try {
str = bf.readLine();
@justudin
justudin / CourseraJupyter2020.md
Last active October 5, 2020 04:40
Download jupyter notebook from Coursera as of 2020-10 via Terminal
  1. Open the terminal via New>Terminal

  2. Check the location of jupyter notebook, in this case is /tf:

ls -l /tf

Notes: Some files are linked, so you have to manually copy those files in order to download the original files. You can use the cp command to copy them. For example: cp originalfilelocation /tf/filename.ori

  1. Set the location and filename:
@justudin
justudin / resizeImg.py
Last active November 16, 2021 16:06
bulk resize image with python with its its corresponding subdirectory/folder
# -*- coding: utf-8 -*-
"""
Created on Tue Oct 27 13:59:03 2020
@author: xyz
This code is used to resize the images from dir/subdir to new directory (newdir/subdir) with its corresponding subdirectory
Original folder with it subdir:
..\DATA\ORI-DIR
@justudin
justudin / backup-monthly.sh
Created October 27, 2020 06:25
Backup MongoDB database and send the file to email every month
#!/bin/sh
# Make sure to:
# - Name this file `backup-monthly.sh` and place it in /home/$userdir
# - Run sudo apt-get install sendemail to install the sendemail for sending the backup file through email
# - Fill in DB host, name, port number, user and password
# - Run chmod +x backup-monthly.sh
# - Test it out via ./backup-monthly.sh
# - Set up a monthly backup via `crontab -e`:
# 0 0 1 * * /home/ubuntu/backup-monthly.sh > /home/ubuntu/backup.log
@justudin
justudin / install-selenium-ubuntu.sh
Last active June 3, 2021 09:04
install-selenium-nodejs-linux.sh
#!/bin/bash
echo "Step 1: Download and install google-chrome-stable"
sudo curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add
sudo echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list
sudo apt-get -y update
sudo apt-get -y install google-chrome-stable
gchrome_installed=$(google-chrome --version 2>&1)
gchrome_version="$(cut -d' ' -f3 <<<"$gchrome_installed")"
echo -e "${gchrome_installed}already successfully installed."
gchrome_version_download="$(cut -d'.' -f1 <<<"$gchrome_version")"
@justudin
justudin / sbi.py
Last active June 3, 2021 09:11
Get sbi won-idr current rate.
"""
Coded by @justudin, 2021.
"""
import requests #pip install requests
import json
from bs4 import BeautifulSoup #pip install BeautifulSoup4
SBI_COSMONEY = "https://www.sbicosmoney.com/"
SBI_COSMONEY_RATE = "https://www.sbicosmoney.com/calc/amount"
Hello there!
I am learning the very basic of Linux commands.
Please bear with me since I am learning from the scratch!!!
Best regards,
Never ever stop learning