Skip to content

Instantly share code, notes, and snippets.

View MohamedElashri's full-sized avatar

Mohamed Elashri MohamedElashri

View GitHub Profile
@MohamedElashri
MohamedElashri / nerd_fonts.sh
Created February 29, 2024 19:50
Install Nerd fonts via homebrew
brew tap homebrew/cask-fonts
brew install --cask font-3270-nerd-font
brew install --cask font-fira-mono-nerd-font
brew install --cask font-inconsolata-go-nerd-font
brew install --cask font-inconsolata-lgc-nerd-font
brew install --cask font-inconsolata-nerd-font
brew install --cask font-monofur-nerd-font
brew install --cask font-overpass-nerd-font
brew install --cask font-ubuntu-mono-nerd-font
@MohamedElashri
MohamedElashri / news_blocklist.txt
Created February 8, 2024 16:40
news outlet dns blocklist
! Title: Custom News Outlet Blocklist
! Description: Blocks major world-famous news outlets published in English.
! Version: 1.0
||nytimes.com^
||theguardian.com^
||washingtonpost.com^
||bbc.co.uk^
||bbc.com^
||cnn.com^
||foxnews.com^
@MohamedElashri
MohamedElashri / hn_dracula.user.js
Last active March 21, 2024 13:05
My HN dracula custom userscript (and other things)
// ==UserScript==
// @name Hacker News Comprehensive Enhancements (Dracula)
// @namespace http://melashri.net/hn
// @version 1.3
// @description A comprehensive enhancement script for Hacker News
// @author melashri
// @match https://news.ycombinator.com/*
// @grant GM_addStyle
// ==/UserScript==
@MohamedElashri
MohamedElashri / nvchad_install.sh
Last active January 26, 2024 00:13
Use nvim as IDE with NvChad
#!/bin/bash
# Check if Neovim is installed
if ! command -v nvim &> /dev/null
then
read -p "Neovim is not installed. Do you have root access to install it globally? (y/n) " root_choice
case "$root_choice" in
y|Y )
# OS-specific Neovim installation
if [[ -x "$(command -v apt-get)" ]]; then
@MohamedElashri
MohamedElashri / config.yaml
Created January 18, 2024 21:08 — forked from lazyfrosch/config.yaml
Fail2Ban configuration for Grafana's Loki promtail
server:
http_listen_port: 9080
grpc_listen_port: 0
positions:
filename: /data/positions.yaml
clients:
- url: ${LOKI_HOST}/loki/api/v1/push
basic_auth:
@MohamedElashri
MohamedElashri / memory_info.c
Last active January 19, 2024 03:52
memory information in mac, alternative tool that provides linux "free" command line utility
/**
* Author: Mohamed Elashri
* Date: 01 Jan 2024
* License: MIT
*
* Description:
* This program is designed to fetch and display memory statistics in a human-readable format.
* It provides detailed information about total, used, free, cached, application, and wired memory,
* along with swap usage for macOS systems. The program uses Mach API and sysctl to gather memory statistics.
*
@MohamedElashri
MohamedElashri / github_freshrss.js
Created December 14, 2023 18:18
Add Github Repository Release to FreshRSS feed
javascript:(function(){
var pathArray = location.pathname.split('/');
if(pathArray.length >= 3 && location.hostname === 'github.com') {
var owner = pathArray[1];
var repo = pathArray[2];
var githubFeedUrl = 'https://github.com/' + owner + '/' + repo + '/releases.atom';
var freshRssUrl = '{freshrss_url_here}/i/?c=feed&a=add&url_rss=' + encodeURIComponent(githubFeedUrl);
window.open(freshRssUrl, '_blank').opener = null;
} else {
alert('Not a GitHub repository page');
@MohamedElashri
MohamedElashri / hn.user.js
Last active March 21, 2024 13:05
This is my standard userstyle for HN
// ==UserScript==
// @name Hacker News Comprehensive Enhancements (Light)
// @namespace http://melashri.net/hn
// @version 1.3
// @description A comprehensive enhancement script for Hacker News
// @author melashri
// @match https://news.ycombinator.com/*
// @grant GM_addStyle
// ==/UserScript==
@MohamedElashri
MohamedElashri / install_helix.sh
Created November 19, 2023 17:35
bash script to automate installing helix editor on supported platforms
#!/bin/bash
# Function to check if a command exists
command_exists() {
command -v "$1" >/dev/null 2>&1
}
# Function to install Helix on Ubuntu
install_on_ubuntu() {
echo "Installing Helix on Ubuntu..."
@MohamedElashri
MohamedElashri / kagi_dracula.css
Last active November 8, 2023 16:41
kagi dracula custom css theme
:root {
--background: #282a36;
--current-line: #44475a;
--selection: #44475a;
--foreground: #f8f8f2;
--comment: #bfbfbf;
--cyan: #8be9fd;
--green: #50fa7b;
--orange: #ffb86c;
--pink: #ff79c6;