Skip to content

Instantly share code, notes, and snippets.

View menasheh's full-sized avatar

Menasheh Peromsik menasheh

View GitHub Profile
@menasheh
menasheh / install.sh
Created April 11, 2018 11:02
Jetbrains Toolbox Installer for Ubuntu
#!/bin/bash
if ! which jetbrains-toolbox &> /dev/null ; then
sudo apt-get install dos2unix
md_tburl=$(curl -I "https://data.services.jetbrains.com/products/download?code=TBA&platform=linux" | dos2unix | grep Location: | cut -d" " -f2)
md_tbfile=$(echo $md_tburl | cut -d/ -f5 | cut -d. -f1-3)
cd ~/Downloads/ || exit 1
wget -c $md_tburl || exit "Could not download Jetbrains Toolbox."
tar -xzvf $md_tbfile.tar.gz
sudo cp $md_tbfile/jetbrains-toolbox /usr/bin/jetbrains-toolbox
jetbrains-toolbox &&
@menasheh
menasheh / delete-old-backups.sh
Created February 26, 2018 01:13
gdrive: Delete Old Backups
#!/bin/bash
FOLDER={{REPLACE WITH BACKUP FOLDER ID}}
KEEP=5
gdrive list --no-header -q "'$FOLDER' in parents" | cut -d " " -f1 | tail -n +$(expr $KEEP + 1) | xargs -n1 -I id gdrive delete id
@menasheh
menasheh / Captive Portal Automatic Log in Instructions
Last active March 9, 2022 11:26
Automatically log in to your school/work/coffeeshop/bus Captive Portal Wifi
Put the following file in /etc/network/if-up.d/ under any name. Make sure to chmod+x.
@menasheh
menasheh / init.js
Created February 23, 2017 07:29
webpack output for a very small file ! ? ! ?
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId])
/******/ return installedModules[moduleId].exports;