Skip to content

Instantly share code, notes, and snippets.

View xvzftube's full-sized avatar
💪
Yelling at a cloud

xvzf xvzftube

💪
Yelling at a cloud
View GitHub Profile
@xvzftube
xvzftube / mount.sh
Created July 29, 2021 16:59
Mount a drive to EC2
sudo fdisk /dev/xvdb
sudo partprobe /dev/xvdb
sudo mkfs /dev/xvdb -t ext4 #n, enter, enter, ... w when prompted again. The w will write
sudo mount /dev/xvdb data/
sudo chown -R ubuntu data
@xvzftube
xvzftube / install.sh
Last active July 29, 2021 14:50
AWS EC2 Ubuntu 18.04
#!/bin/sh
# License: GNU GPLv3
sudo apt-get update && apt-get upgrade -y
# install other common utils
sudo apt-get install build-essential wget curl make tmux git python3-pip neofetch stow -y
# Download recent neovim
curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim.appimage
chmod u+x nvim.appimage
@xvzftube
xvzftube / aws_ec2_deb.sh
Created July 29, 2021 13:39
This is an install script for setting up an ec2 (Debian 10)
#!/bin/sh
# License: GNU GPLv3
sudo apt-get update && apt-get upgrade -y
# install other common utils
sudo apt-get install build-essential wget curl neovim make tmux git python3-pip neofetch stow -y
# R section inspired by https://cran.r-project.org/bin/linux/debian/
# R - dependencies necessary to add a new repository over HTTPS (CRAN GPG depends on these)
sudo apt-get install dirmngr apt-transport-https ca-certificates software-properties-common gnupg2
@xvzftube
xvzftube / demo_csvtx.sh
Created July 3, 2021 21:16
csvtk video review
tar -xvzf ~/Downloads/csvtk_linux_amd64.tar.gz
ls
sudo cp csvtk /usr/local/bin/
csvtk
wget https://raw.githubusercontent.com/tidyverse/ggplot2/master/data-raw/diamonds.csv
cat diamonds.csv | head
csvtk pretty diamonds.csv | head
cat diamonds.csv | csvtk summary depth:sum --groups cut |
cat diamonds.csv | csvtk summary depth:sum --groups cut | csvtk pretty
cat diamonds.csv | csvtk summary --fields depth:sum --groups cut | csvtk pretty
@xvzftube
xvzftube / q.sh
Created March 6, 2021 14:53
Using q to run sql-like commands in the command line.
#!/bin/bash
wget https://github.com/harelba/q/releases/download/2.0.19/q-text-as-data_2.0.19-2_amd64.deb
sudo dpkg -i q-text-as-data_2.0.19-2_amd64.deb
wget https://gist.githubusercontent.com/sarchak/b87ad2be315ce05f7a047550646f3c41/raw/0c7d83608111f74f212398fc0d2a704e4f8dc499/diamonds.csv
q -HOd , "select * from diamonds.csv limit 10"
#!/bin/sh
# License: GNU GPLv3
sudo apt-get update && apt-get upgrade -y
# install other common utils
sudo apt-get install build-essential wget curl neovim make tmux git python3-pip neofetch stow -y
# R section inspired by https://cran.r-project.org/bin/linux/debian/
# R - dependencies necessary to add a new repository over HTTPS (CRAN GPG depends on these)
sudo apt-get install dirmngr apt-transport-https ca-certificates software-properties-common gnupg2
@xvzftube
xvzftube / background_picker.sh
Last active January 1, 2021 14:47
Select wallpaper from sxiv and set as wallpaper
#!/bin/bash
sudo apt install xwallpaper
sudo apt install sxiv
git clone https://gist.github.com/85942af486eb79118467.git ~/wallpapers
# Enter to get into thumbnail mode
# Mark desired image with M
# Wallpaper will set when window closes
sxiv -r -q -o * | xargs xwallpaper --stretch
@xvzftube
xvzftube / dwm_setup.sh
Last active March 15, 2023 22:01
dwm setup
#!/bin/sh
# License: GNU GPLv3
sudo apt-get update && sudo apt-get upgrade -y
# assumes no desktop environment -- must install Xorg things
sudo apt-get --no-install-recommends install xserver-xorg xserver-xorg-video-fbdev \
xinit pciutils xinput xfonts-100dpi xfonts-75dpi xfonts-scalable libx11-dev libxft-dev libxinerama-dev xorg-dev -y
# install other common utils
sudo apt-get install build-essential curl neovim make tmux git python3-pip neofetch stow -y
@xvzftube
xvzftube / xmonad_setup.sh
Last active December 25, 2020 06:17
xmonad setup
# in debian session use the following commands then logout
sudo apt install xmonad libghc-xmonad-contrib-dev xterm dmenu
# get an xmonad.hs file
cd ~/.xmonad/ && wget http://code.haskell.org/xmonad/man/xmonad.hs && cd
cd /usr/share/fonts && sudo https://github.com/adobe-fonts/source-code-pro.git && cd && sudo fc-cache -fv
# install st and set font. If something goes wrong delete config.h and try again manually.
git clone https://git.suckless.org/st
cd st
sed -i '7 a static char *font = "Source Code Pro:pixelsize=18:antialias=true:autohint=true";' config.def.h
sed -i '9d' config.def.h
@xvzftube
xvzftube / vbox_guest.sh
Last active December 25, 2020 06:41
Virtualbox Guest additions
#!/bin/sh
# Devices -> Insert guest additions
sudo apt update
sudo apt install build-essential dkms linux-headers-$(uname -r)
sudo mkdir -p /mnt/cdrom
sudo mount /dev/cdrom /mnt/
cd /mnt
sudo ./VBoxLinuxAdditions.run --nox11
sudo shutdown -r now