Skip to content

Instantly share code, notes, and snippets.

🤠

Yiğit Özkavcı yigitozkavci

🤠
Block or report user

Report or block yigitozkavci

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@yigitozkavci
yigitozkavci / Broadcaster.md
Last active Nov 4, 2019
Broadcaster Interview Question
View Broadcaster.md

Broadcaster

Create a binary that, when executed, links itself to other broadcaster binaries that are running. This binary is able to receive instructions to display and broadcast a message to other broadcasters it's linked to.

The resulting graph of linked broadcasters should always constitute a spanning tree, in other words, all of them should be connected and there shouldn't be any redundant edges.

Example

$ broadcaster --port 8000
Started listening for instructions on :8000.
@yigitozkavci
yigitozkavci / phon.sh
Created Jul 15, 2018
Small script for finding phonetic description of words
View phon.sh
phon() {
f=$(mktemp)
curl -sX GET -H 'User-Agent: Mozilla/4.0' "http://www.phonemicchart.com/transcribe/?w=$1" > "$f"
xmllint --xpath "//center/span/text()" --html $f 2>/dev/null
rm $f
}
# Example usage:
# $ phon merry
# > /'mærɪ/
View cenary_proof.v
Require Coq.Lists.List.
Require Coq.Program.Basics.
(* Utility Functions *)
Inductive Maybe (A : Type) : Type :=
| Nothing : Maybe A
| Just : A -> Maybe A.
Inductive stackValue : Set :=
@yigitozkavci
yigitozkavci / swap_ubuntu
Created Jul 19, 2017
Add and configure swap space on ubuntu
View swap_ubuntu
SWAP_SIZE="1G" # Generally x1 or x2 of your memory is sufficient
sudo fallocate -l "$SWAP_SIZE" /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
echo 'vm.swappiness=10' | sudo tee -a /etc/sysctl.conf
echo 'vm.vfs_cache_pressure=50' | sudo tee -a /etc/sysctl.conf
@yigitozkavci
yigitozkavci / unrootify_ubuntu
Last active Aug 29, 2019
Unrootify yourself in a newly created ubuntu instance
View unrootify_ubuntu
export USERNAME=yigit
echo -e "\n\nAllowUsers root $USERNAME" >> /etc/ssh/sshd_config
sudo service ssh restart
mkdir -p /home/$USERNAME/.ssh
cp /root/.ssh/authorized_keys /home/$USERNAME/.ssh
sudo adduser $USERNAME
sudo adduser $USERNAME sudo
sudo chown -R $USERNAME /home/$USERNAME
# To make this user a ssh user
You can’t perform that action at this time.