parent
d3568884fe
commit
a79bd35f11
@ -0,0 +1,57 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
setVim(){
|
||||||
|
echo "hi comment ctermfg=3
|
||||||
|
set hlsearch
|
||||||
|
|
||||||
|
if has(\"autocmd\")
|
||||||
|
au BufReadPost * if line(\"'\\\"\") > 1 && line(\"'\\\"\") <= line(\"$\") | exe \"normal! g'\\\"\" | endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
" > ~/.vimrc
|
||||||
|
}
|
||||||
|
|
||||||
|
setVim
|
||||||
|
|
||||||
|
#remember github username and password
|
||||||
|
git config --global credential.helper store
|
||||||
|
|
||||||
|
do_partition() {
|
||||||
|
echo "doing partition"
|
||||||
|
echo "n
|
||||||
|
p
|
||||||
|
1
|
||||||
|
|
||||||
|
+400G
|
||||||
|
w
|
||||||
|
" | sudo fdisk /dev/sdb && sleep 4 && sudo mkfs.ext4 /dev/sdb1
|
||||||
|
}
|
||||||
|
|
||||||
|
add_partition() {
|
||||||
|
has_sdb=`sudo fdisk -l /dev/sdb|grep "/dev/sdb: 1.9 TiB"`
|
||||||
|
no_partition=`sudo fdisk -l /dev/sdb|grep "Device"`
|
||||||
|
#echo $has_sdb
|
||||||
|
if [[ $has_sdb == *"Disk /dev/sdb: 1.9 TiB"* ]]; then
|
||||||
|
if [ -z "$no_partition" ];
|
||||||
|
then
|
||||||
|
do_partition
|
||||||
|
else
|
||||||
|
echo "/dev/sdb already has paritions"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "no /dev/sdb or its capacity is not 1.1 TiB"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
mount_partition() {
|
||||||
|
sudo mkdir /my_mount
|
||||||
|
sudo mount /dev/sda4 /my_mount
|
||||||
|
df -h
|
||||||
|
}
|
||||||
|
#add_partition
|
||||||
|
sudo mkfs.ext4 /dev/sda4
|
||||||
|
mount_partition
|
||||||
|
sudo chmod 777 /my_mount
|
||||||
|
|
@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# DISCLAIMER:
|
||||||
|
# Script taken from http://askubuntu.com/questions/201937/ubuntu-detect-4-cpus-and-i-have-only-2-cpus
|
||||||
|
|
||||||
|
|
||||||
|
echo "Disabling hyperthreading..."
|
||||||
|
|
||||||
|
CPUS_TO_SKIP=" $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | sed 's/[^0-9].*//' | sort | uniq | tr "\r\n" " ") "
|
||||||
|
|
||||||
|
# Disable Hyperthreading
|
||||||
|
for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]*; do
|
||||||
|
CPU="$(echo $CPU_PATH | tr -cd "0-9")"
|
||||||
|
echo "$CPUS_TO_SKIP" | grep " $CPU " > /dev/null
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
echo 0 > $CPU_PATH/online
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
lscpu | grep -i -E "^CPU\(s\):|core|socket"
|
||||||
|
|
@ -0,0 +1 @@
|
|||||||
|
sudo cpupower frequency-set -g performance
|
Loading…
Reference in new issue