Skip to content

Instantly share code, notes, and snippets.

View ilhamarrouf's full-sized avatar
🏠
Working from home

Ilham Arrouf ilhamarrouf

🏠
Working from home
View GitHub Profile
@ilhamarrouf
ilhamarrouf / employees.csv
Last active April 1, 2024 14:33
Data Analytics Part 1
EmployeeID Age Department YearsOfExperience Salary PerformanceRating EducationLevel Gender MaritalStatus OvertimeHours PromotionReceived
1 30 Engineering 5 60000 Excellent Bachelor's Male Married 10 Yes
2 35 Marketing 8 65000 Good Master's Female Single 5 No
3 45 Engineering 15 85000 Excellent Bachelor's Male Married 15 No
4 28 Finance 3 55000 Fair Bachelor's Female Married 3 Yes
5 40 HR 10 70000 Good Master's Male Single 8 Yes
6 33 Finance 6 62000 Fair Bachelor's Female Married 4 No
7 38 Marketing 12 75000 Excellent Master's Male Married 12 Yes
8 42 Engineering 18 90000 Excellent PhD Female Single 20 No
9 25 HR 2 50000 Fair Bachelor's Male Single 2 No
@ilhamarrouf
ilhamarrouf / setup.sh
Created June 18, 2023 02:47
Connection Setup
# setup with command $ bash <curl -s <raw url>)
ssh-keygen –t rsa
ssh-add ~/.ssh/id_rsa.pub
eval `ssh-agent -s`
cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
# Copy the public key to the remote machine
# cat ~/.ssh/id_rsa.pub | ssh username@remote_machine_ip "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && cat >> ~/.ssh/authorized_keys"
@ilhamarrouf
ilhamarrouf / autoscript.sh
Last active June 18, 2023 03:02
Auto Script Setup k8s Utils
# setup with command $ bash <curl -s <raw url>)
# Kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
kubectl version --client
echo complete install kubectl
@ilhamarrouf
ilhamarrouf / readme.md
Last active June 18, 2023 03:01
Setup SFTP

Enable SFTP Without Shell Access on Ubuntu 22.04

Prerequisites

To follow this tutorial, you will need:

  • One Ubuntu 22.04 server set up with this initial server setup tutorial, including a sudo non-root user and a firewall.

Step 1 — Creating a New User

$ sudo adduser ftpuser

Step 2 — Creating a Directory for File Transfers

@ilhamarrouf
ilhamarrouf / roman-number.js
Created September 22, 2021 08:11
Convert To Roman Number
function romanNumber(num) {
if (typeof num !== 'number') {
return false;
}
let digits = String(+num).split("");
let key = ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM","","X","XX","XXX","XL","L","LX","LXX","LXXX","XC","","I","II","III","IV","V","VI","VII","VIII","IX"];
let romanNum = "";
let i = 3;
@ilhamarrouf
ilhamarrouf / uuid.js
Created August 11, 2021 14:47
Generate UUID V4
function uuid() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}
@ilhamarrouf
ilhamarrouf / index.js
Created April 1, 2021 07:10
Iterate Date Range
const moment = require('moment');
let a = moment('2013-01-01');
let b = moment('2013-06-01');
// If you want an exclusive end date (half-open interval)
for (let m = moment(a); m.isBefore(b); m.add(1, 'days')) {
console.log(m.format('YYYY-MM-DD'));
}
@ilhamarrouf
ilhamarrouf / user.go
Created March 16, 2021 12:58
Go lets you create your own data type using structs
type User struct {
name string
age int
}
tole := User {
name: "Scott",
age: 23,
}
@ilhamarrouf
ilhamarrouf / index.js
Created February 25, 2021 06:49
Get base path NodeJS
const path = require('path');
console.log(path.dirname(require.main.filename));
@ilhamarrouf
ilhamarrouf / encrypt-decrypt.js
Last active March 14, 2021 00:09
Vigenete Cipher
function isUpperCase(letter){
let l = letter.charCodeAt();
return l >= 65 && l <= 90;
}
function isLowerCase(letter){
let l = letter.charCodeAt();
return l >= 97 && l <= 122;