Skip to content

Instantly share code, notes, and snippets.

@azizzaeny
Last active March 25, 2018 07:56
Show Gist options
  • Save azizzaeny/810a75263f00eee69dcbfd17ab2e9f17 to your computer and use it in GitHub Desktop.
Save azizzaeny/810a75263f00eee69dcbfd17ab2e9f17 to your computer and use it in GitHub Desktop.
all my bin files
oc
boot
lein
.#*

what ?

to make easy, and not remeber all of this typo mistake bin folder on my home foler

#!/bin/bash
# asume use is io
sudo chown -R io:io /home/io/.emacs.d/
#!/bin/bash
sudo chown io:io /media/io/
sudo chown io:io /media/io/flash/
sudo chown io:io /media/io/EFI/
#!/bin/bash
sudo swapoff /mnt/host/swapfile
#!/bin/bash
# Selected options for "emacsclient"
#
# -c Create a new frame instead of trying to use the current
# Emacs frame.
#
# -e Evaluate the FILE arguments as ELisp expressions.
#
# -n Don't wait for the server to return.
#
# -t Open a new Emacs frame on the current terminal.
#
# Note that the "-t" and "-n" options are contradictory: "-t" says to
# take control of the current text terminal to create a new client frame,
# while "-n" says not to take control of the text terminal. If you
# supply both options, Emacs visits the specified files(s) in an existing
# frame rather than a new client frame, negating the effect of "-t".
# check whether an Emacs server is already running
pgrep -l "^emacs$" > /dev/null
# otherwise, start Emacs server daemon
if [ $? -ne 0 ]; then
emacs --daemon
fi
# return a list of all frames on $DISPLAY
emacsclient -e "(frames-on-display-list \"$DISPLAY\")" &>/dev/null
# open frames detected, so open files in current frame
if [ $? -eq 0 ]; then
emacsclient -n -t "$@"
# no open frames detected, so open new frame
else
emacsclient -n -c "$@"
fi
#!/bin/bash
# this asume swapfile mounted host
sudo chmod 0600 /mnt/host/swapfile
sudo mkswap /mnt/host/swapfile
sudo swapon /mnt/host/swapfile
#!/bin/bash
# asume mnt/host already mounted
# and file are /mnt/host/persist-chrome and /mnt/host/persist-down
sudo /home/io/bin/umount-downloads
sudo /home/io/bin/umount-chrome
sudo fsck -l /mnt/host/persist-chrome
sudo fsck -l /mnt/host/persist-down
#!/bin/bash
# git add all commit message arguments into origin master branch
git add .
git commit -m "$*"
git push origin master
sudo mksquashfs overlay filesystem.squashfs.xz -info -progress -comp xz -b 1048576 -Xdict-size 100%
#!/bin/bash
# asume host already mounted on /mnt/host
# which name of file persist-down
sudo mount -t ext4 -o rw,loop /mnt/host/persist-down /home/io/Downloads/
sudo chown io:io /home/io/Downloads/
#!/bin/bash
# mount /mnt/host/img/home.sqsh /mnt/home
echo "this feature disabled for a a while because home would divided"
#!/bin/bash
# mounting host depends on drive usualy /dev/sda1 but in this case we get /dev/sda3
sudo mkdir -p /mnt/host
sudo mount -t ntfs -o rw $1 /mnt/host
# check arguments should like that
#!/bin/bash
# asume host already mounted on /mnt/host
# which name file persist-chrome
# asume name media flash
sudo /home/io/bin/chown-flash
sudo mkdir -p /mnt/{overlay-chrome,overlay-chrome-ro}
sudo mount -o ro -t squashfs /media/io/flash/google.sqsh /mnt/overlay-chrome-ro/
# sudo mount -o rw,loop -t ext4 /mnt/host/persist-chrome /mnt/overlay-chrome/
sudo mount -t tmpfs none /mnt/overlay-chrome/
sudo mkdir -p /mnt/overlay-chrome/{rw,work}
sudo mount -t overlay -o lowerdir=/mnt/overlay-chrome-ro/,upperdir=/mnt/overlay-chrome/rw/,workdir=/mnt/overlay-chrome/work/ overlay /home/io/.config/google-chrome/
sudo chown io:io /home/io/.config/google-chrome/
#!/bin/bash
sudo mkdir -p /mnt/{overlay,lower,rw}
sudo mount -t squashfs -o ro,loop filesystem.squashfs /mnt/lower
sudo mount -t tmpfs none /mnt/rw
sudo mkdir -p /mnt/rw/{work,upper}
sudo mount -t overlay -o lowerdir=/mnt/lower,upperdir=/mnt/rw/upper,workdir=/mnt/rw/work overlay /mnt/overlay
#!/bin/bash
sync
/home/io/bin/umount-host
echo "choose host on $1"
/home/io/bin/mount-host $1
/home/io/bin/mount-downloads
/home/io/bin/overlay-chrome
/home/io/bin/enable-swap
sudo df -ah
sudo free -h
#!/bin/bash
sync
/home/io/bin/umount-downloads
/home/io/bin/umount-chrome
/home/io/bin/disable-swap
/home/io/bin/umount-host
sudo df -ah
#!/bin/bash
boot -C cider repl -s wait
#!/bin/bash
sudo umount /home/io/.config/google-chrome/
sudo umount /mnt/overlay-chrome/
sudo umount /mnt/overlay-chrome-ro/
#!/bin/bash
# asume downloads already mounted on host
sudo umount /home/io/Downloads/
#!/bin/bash
sudo umount /mnt/host
#!/bin/bash
echo "/lib/live/mount/persistence/"
#!/bin/bash
# required arguments $! uuid
nmcli c up uuid $1
#!/bin/bash
nmcli c down uuid b45e370d-310f-4a85-8cb6-dfa20eb3c828
#!/bin/bash
nmcli c
#!/bin/bash
nmcli c up uuid b45e370d-310f-4a85-8cb6-dfa20eb3c828
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment