Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Eric Han eric-vader

🎯
Focusing
View GitHub Profile
View dd_obs_test.sh
#!/bin/bash
# Since we're dealing with dd, abort if any errors occur
set -e
TEST_FILE=${1:-dd_obs_testfile}
[ -e "$TEST_FILE" ]; TEST_FILE_EXISTS=$?
TEST_FILE_SIZE=134217728
# Header
@eric-vader
eric-vader / unwatch-gh-org.js
Last active Jan 21, 2021 — forked from offirgolan/unwatch-gh-org.js
Unwatch All Org Repos
View unwatch-gh-org.js
// Navigate to https://github.com/watching and then run:
(function() {
let qx = $x;
let unwatch = function(org, notificationType) {
let nodes = document.querySelectorAll('.Box-row');
let rows = [ ...nodes ];
let orgRows = rows.filter(e => e.innerText.startsWith(`${org}/`));
let orgUnsubButtons = orgRows.map(row => row.querySelector(`button.SelectMenu-item[value="${notificationType}"]`));
orgUnsubButtons.forEach(button => console.log(button.click()));
@eric-vader
eric-vader / increase_root_fedora.md
Created Mar 10, 2020 — forked from 181192/increase_root_fedora.md
How to increase the root partition size on Fedora
View increase_root_fedora.md

How to increase the root partition size on Fedora

Boot up with an Fedora Live USB stick.

  1. Run vgs to check if there's any space:
$ sudo vgs
  VG     #PV #LV #SN Attr   VSize    VFree
  fedora   1   3   0 wz--n- <237.28g    0 
View Nvidia Fedora FC28.sh
sudo dnf config-manager --add-repo=https://negativo17.org/repos/fedora-nvidia.repo
sudo dnf install kernel-devel dkms dkms-nvidia nvidia-driver nvidia-settings vulkan.i686 nvidia-driver-libs.i686
sudo dkms autoinstall
View Android Studio
echo "
[Desktop Entry]
Name=Android Studio
Exec=/opt/google/android-studio/bin/studio.sh
Icon=/opt/google/android-studio/bin/studio.png
Type=Application" > ~/.local/share/applications/android-studio.desktop
@eric-vader
eric-vader / setup_ledger.sh
Last active May 28, 2018 — forked from ptantiku/setup_ledger.sh
Setup Ledger Nano S in Linux, with fixing problem on Fedora
View setup_ledger.sh
#!/bin/bash
# Setup Ledger Nano S in Linux
# according to http://support.ledgerwallet.com/knowledge_base/topics/ledger-wallet-is-not-recognized-on-linux
# However, in Fedora, the "plugdev" group is not existed (obsolete).
# The solution is to replace `GROUP=\"plugdev\"` to `OWNER=\"<username>\"` in the script, for example:
# Original rule: SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", GROUP="plugdev"
# Change to: SUBSYSTEMS=="usb", ATTRS{idVendor}=="2c97", ATTRS{idProduct}=="0001", MODE="0660", OWNER="ptantiku"
#wget -q -O - https://www.ledgerwallet.com/support/add_udev_rules.sh | sed -re 's/GROUP=\\"plugdev\\"/OWNER=\\"'$(whoami)'\\"/' | sudo bash
@eric-vader
eric-vader / convert.sh
Last active Nov 8, 2019
Converts all mov files to mp4 using handbrake
View convert.sh
#!/bin/bash
# Make sure globstar is enabled
if [[ $# -ne 2 ]] ; then
echo 'Must have 2 arguments!'
exit 1
fi
shopt -s globstar
for EXT in mov MOV
do
for i in $1/**/*.$EXT; do # Whitespace-safe and recursive
View info.sh
#/bin/hash
###########################################################################################################
DATE=`/bin/date +date_%d-%m-%y_time_%H-%M-%S`
Time(){
###### STARTING PROGRAMMING AND TYPING THE USER INTERFACE ##########
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
echo "<br>"
echo " Computer Time : `date` <br>"
@eric-vader
eric-vader / setup-fedora.sh
Last active May 10, 2020
My personal setup script!
View setup-fedora.sh
#!/bin/bash
# Fix Gnome settings
# ==================
# gsettings set org.gnome.desktop.interface scaling-factor 1
# sudo vi /usr/share/glib-2.0/schemas/org.gnome.desktop.interface.gschema.xml
# sudo glib-compile-schemas /usr/share/glib-2.0/schemas/
# Install VirtualBox
# ==================
#dnf config-manager --add-repo http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo -y
#dnf install binutils gcc make patch libgomp glibc-headers glibc-devel kernel-headers kernel-devel kernel-core-devel dkms -y
View test
//============================================================================
// Name : test1.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
#include <math.h>