Skip to content

Instantly share code, notes, and snippets.

View adzkar's full-sized avatar
πŸ’©
Sleeping . . .

Adzkar adzkar

πŸ’©
Sleeping . . .
View GitHub Profile
#!/bin/bash
gnuplot -persist <<"EOF"
set style data linespoints
show timestamp
set xlabel "time (seconds)"
set ylabel "Segments (cwnd, ssthresh)"
plot "reno.txt" using 1:7 title "snd_cwnd", \
"reno.txt" using 1:($8>=2147483647 ? 0 : $8) title "snd_ssthresh"
EOF
import numpy as np
from math import log
#suhu 3bit (tp), waktu 4 bit (tm), kondisi langit 4 bit(sky), kelembapan 3bit(hm)
# suhu: rendah, normal, tinggi
# waktu: pagi, siang, sore, malam
# kondisi: cerah, berawan, rintik, hujan
# kelembapan: rendah, normal, tinggi
def entropy(total, yes, no):
y = yes/float(total)
@adzkar
adzkar / 123.py
Created September 27, 2019 01:19
import string
datas = raw_input().split(' ')
f = []
f.append('{}:a'.format(datas[0]))
f.append('{}:b'.format(datas[1]))
f.append('{}:c'.format(datas[2]))
x = []
@adzkar
adzkar / abc.py
Created September 27, 2019 00:43
import string
alpha = string.ascii_uppercase
while True:
datas = raw_input()
x, y, z = map(lambda x: x.upper(), datas)
p = alpha.index(y) - (alpha.index(x)+1)
@adzkar
adzkar / pda.cpp
Last active December 6, 2018 17:03
Tubes TBA
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
// Initial Some Function
#define pop(pda, i) pda.erase(remove(pda.begin(), pda.end(), i), pda.end())
#define push(pda, i) pda.push_back(i)
@adzkar
adzkar / gist:d51e3689a9552e9d753c9fd22186ee92
Created June 22, 2018 15:59 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@adzkar
adzkar / file.txt
Created May 25, 2018 23:52
Kill Force Running Port
You can kill the port
sudo kill $(sudo lsof -t -i:port_number)
Like if it is running on 8000, you can do below
sudo kill $(sudo lsof -t -i:8000)
@adzkar
adzkar / 000-default.conf
Created May 25, 2018 23:37
Apache2 Site-available Default Configuration
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
@adzkar
adzkar / gist:4e92e6068302cbdf12bd8a94b8404216
Created May 23, 2018 02:09 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@adzkar
adzkar / beautifulUbuntu.md
Created March 31, 2018 07:57 — forked from NTag/beautifulUbuntu.md
Beautiful Terminal with Ubuntu 14.04 LTS
  1. Install ZSH
    • sudo apt-get install git zsh
  2. Install OhMyZSH
    • sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
  3. Install zsh-autosuggestions
    • git clone git://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
    • Edit ~/.zshrc and replace line plugins=(git) with plugins=(git zsh-autosuggestions)
    • Create a file ~/.oh-my-zsh/custom/colors.zsh containing ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=240'
  4. Install zsh-syntax-highlighting
  • git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting