Skip to content

Instantly share code, notes, and snippets.

View harisfi's full-sized avatar
🎯
Focusing

Haris F. harisfi

🎯
Focusing
View GitHub Profile
@harisfi
harisfi / hdd_speed.sh
Created January 17, 2021 14:59
Calculate HDD speed (100MB/s = normal)
#!/bin/sh
dd bs=1M count=512 if=/dev/zero of=test conv=fdatasync; rm -f test
##############################################################################
# VIM CHEATSHEET
# WEBSITE: http://www.vim.org/
# DOCUMENTATION: https://vim.sourceforge.io/docs.php
##############################################################################
##############################################################################
# CURSOR MOVEMENTS
##############################################################################
#!/bin/sh
browser-sync start --server --directory --files "*"
@harisfi
harisfi / 00_etc-hosts.md
Created April 5, 2021 14:10 — forked from mul14/00_etc-hosts.md
/etc/hosts for Vimeo, Reddit, and Imgur.

Unblock Vimeo, Reddit, Imgur, dan NPM

Saya support Internet Positif untuk memblokir porn, situs judi, dan hal-hal ilegal lainnya. Tapi pemerintah dan ISP sangat konyol karena tidak mengizinkan akses ke Vimeo, Reddit, Imgur, Netflix--yang mana bukanlah situs dengan konten utama ilegal.

Linux / BSD / macOS

Tambahkan list di bawah ke /etc/hosts.

Windows

1.Run git clone <my-cool-project>
2.Run composer install
3.Run cp .env.example .env
4.Run php artisan key:generate
5.Run php artisan migrate
6.Run php artisan serve
7.Go to link localhost:8000
for(let i = 1; i <= 28; i++) {
var radio = document.getElementsByName(i)
for(let j=0; j<radio.length; j++) {
if(radio[j].value == 5) {
radio[j].checked = true
}
}
}
document.getElementById('saran').value = 'Pembelajaran sangat baik! Terima kasih atas materi yang disampaikan. Mohon maaf sebesar-besarnya apabila saya banyak salah.'
=== COMPETITION ===
// coming soon
https://hology.ub.ac.id/
https://www.arkavidia.id/
// active
http://creanomic.ub.ac.id/
https://www.compfest.id/
https://ittoday.id/
@harisfi
harisfi / splitTraffic.js
Created September 3, 2021 15:55
Split large traffic into pieces, so there will no more server down :)
function splitTraffic() {
const origServerList = [
'server1',
'server2',
'server3',
'server4',
];
const serverCount = origServerList.length;
const firstServer = origServerList[Math.floor(Math.random() * serverCount)];
let modServerList = origServerList.filter(serv => serv !== firstServer);
mongodump --uri "mongodb+srv://<your username>:<your password>@<your cluster>.mongodb.net/sample_supplies"
mongoexport --uri="mongodb+srv://<your username>:<your password>@<your cluster>.mongodb.net/sample_supplies" --collection=sales --out=sales.json
mongorestore --uri "mongodb+srv://<your username>:<your password>@<your cluster>.mongodb.net/sample_supplies" --drop dump
mongoimport --uri="mongodb+srv://<your username>:<your password>@<your cluster>.mongodb.net/sample_supplies" --drop sales.json
@harisfi
harisfi / postgresql-pgadmin4.md
Last active October 27, 2022 15:26
Script for starting and stopping postgresql service and pgadmin4

Script for starting and stopping postgresql service and pgadmin4

Place code below in pgadmin4 directory, set each file permission to executable, and you can use it.


start.sh

#!/bin/sh

sudo systemctl start postgresql