Skip to content

Instantly share code, notes, and snippets.

View yousefvand's full-sized avatar

Remisa Y Phillips yousefvand

  • Brighton, UK
View GitHub Profile
@yousefvand
yousefvand / tasks.json
Created July 19, 2024 12:20
vscode C++ compiler options
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: g++ build active file",
"command": "/usr/bin/g++",
"args": [
"-std=c++20",
"-fdiagnostics-color=always",
"-Werror",
@yousefvand
yousefvand / mkv-extractor-fix.sh
Created September 18, 2020 16:05
MKV Extractor Fix
#!/usr/bin/env bash
# Fix MKV Extractor wrong state issue.
# Delete config file according to your distro.
rm -f "$HOME/.config/MKV Extractor Qt5.conf"
@yousefvand
yousefvand / plasma-fix.sh
Created September 12, 2020 16:32
Remove problematic Plasmoid from KDE
#!/usr/bin/env bash
problematicPlasmoid='org.kde.plasma.eventcalendar'
plasmoidsPath="${HOME}/.local/share/plasma/plasmoids"
echo "Removing problematic KDE Plasmoid: ${problematicPlasmoid}"
kpackagetool5 -t Plasma/Applet --remove "${plasmoidsPath}/${problematicPlasmoid}"
kstart5 plasmashell &
@yousefvand
yousefvand / grub-greeting-remover.md
Created August 11, 2020 10:00
Removing GRUB greeting message

How to remove "Welcome to GRUB!" message at boot time

This can be done via one line of commmand but before that make sure:

  1. You have a backup of your grubx64.efi file.

  2. You have a bootable rescue CD/USB (like Ubuntu or Archlinux).

The grubx64.efi file path is usually at /boot/efi/EFI/distro/grubx64.efi.

import numpy as np
from pathlib import Path
import matplotlib.pyplot as plt
from matplotlib import animation
file_name = Path(__file__).resolve().stem
def circle(a, b, r):
resolution = 100
@yousefvand
yousefvand / advanced-chat.js
Created May 5, 2020 12:50
Hoolichat node.js chat application (simple & andvanced)
// ========== Server ==========
const net = require('net')
const server = net.createServer()
const { Transform } = require('stream')
const HOST = 'localhost'
const PORT = 8000
const identityStreamTx = new Transform({
@yousefvand
yousefvand / progress-bar.py
Created March 14, 2020 15:47
progress bar for Jupyter (Google colab, Kaggle, ...)
# ref: https://stackoverflow.com/a/46939639
from IPython.display import HTML, display
def pb(title, subtitle, value, max=100):
return HTML("""
<h3>{title}</h3>
<p>{subtitle}</p>
<progress value='{value}' max='{max}', style='width: 95%'>{value}</progress>
""".format(title=title, subtitle=subtitle, value=value, max=max))
@yousefvand
yousefvand / chat.js
Created April 29, 2019 12:22
Node.js socket client server example (chat)
// Server
const net = require('net')
const port = 9000
const stdin = process.openStdin()
const server = net.createServer(socket => {
console.log("Server started...")
@yousefvand
yousefvand / mount-s3.sh
Created April 12, 2019 09:30
Mount Amazon S3 as File System
#!/usr/bin/env bash
function banner_simple() {
local msg="* $* *"
local edge=`echo "$msg" | sed 's/./*/g'`
echo "$edge"
echo "`tput bold`$msg`tput sgr0`"
echo "$edge"
echo
}
#!/usr/bin/env bash
echo "Installing docker Community Edition..."
echo
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo rm -f /etc/apt/sources.list.d/docker-ce.list 2> /dev/null
sudo rm -f /etc/apt/sources.list.d/docker-ce.list.save 2> /dev/null
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker-ce.list > /dev/null