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 / install.sh
Created August 30, 2024 13:21 — forked from safebuffer/install.sh
Install FortiClient 7.0 VPN on Kali Linux
curl -p --insecure "http://ftp.br.debian.org/debian/pool/main/liba/libappindicator/libappindicator1_0.4.92-8_amd64.deb" --output libappindicator1_0.4.92-8_amd64.deb
curl -p --insecure "http://ftp.br.debian.org/debian/pool/main/libi/libindicator/libindicator7_0.5.0-4_amd64.deb" --output libindicator7_0.5.0-4_amd64.deb
wget https://filestore.fortinet.com/forticlient/downloads/forticlient_vpn_7.0.0.0018_amd64.deb
sudo dpkg -i libindicator7_0.5.0-4_amd64.deb
sudo apt-get install libdbusmenu-gtk4
sudo apt-get install libgconf-2-4
sudo dpkg -i libappindicator1_0.4.92-8_amd64.deb
sudo dpkg -i forticlient_vpn_7.0.0.0018_amd64.deb
@ilhamarrouf
ilhamarrouf / docker-volume-transfer.md
Created August 23, 2024 02:21 — forked from etoosamoe/docker-volume-transfer.md
How to transfer Docker Volumes to another host

Goal

You have docker volume on one host and want to move that volume to another host. For example, you want to transfer PostgreSQL container with it's volume to another host.

Solution

Actually, there is no in-a-box solution from Docker, so we need to:

  • attach our volume to another container
  • copy and archive all files
  • copy archive to another host
@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 November 3, 2024 12:08
Auto Script Setup k8s Utils
# setup with command $ bash <(curl -s 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,
}