File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ setVim (){
4+ echo " hi comment ctermfg=3
5+ set hlsearch
6+
7+ if has(\" autocmd\" )
8+ au BufReadPost * if line(\" '\\\"\" ) > 1 && line(\" '\\\"\" ) <= line(\" $\" ) | exe \" normal! g'\\\"\" | endif
9+ endif
10+
11+ " > ~ /.vimrc
12+ }
13+
14+ setVim
15+
16+ # remember github username and password
17+ git config --global credential.helper store
18+
19+ do_partition () {
20+ echo " doing partition"
21+ echo " n
22+ p
23+ 1
24+
25+ +400G
26+ w
27+ " | sudo fdisk /dev/sdb && sleep 4 && sudo mkfs.ext4 /dev/sdb1
28+ }
29+
30+ add_partition () {
31+ has_sdb=` sudo fdisk -l /dev/sdb| grep " /dev/sdb: 1.9 TiB" `
32+ no_partition=` sudo fdisk -l /dev/sdb| grep " Device" `
33+ # echo $has_sdb
34+ if [[ $has_sdb == * " Disk /dev/sdb: 1.9 TiB" * ]]; then
35+ if [ -z " $no_partition " ];
36+ then
37+ do_partition
38+ else
39+ echo " /dev/sdb already has paritions"
40+ exit
41+ fi
42+ else
43+ echo " no /dev/sdb or its capacity is not 1.1 TiB"
44+ exit
45+ fi
46+ }
47+
48+ mount_partition () {
49+ sudo mkdir /my_mount
50+ sudo mount /dev/sda4 /my_mount
51+ df -h
52+ }
53+ # add_partition
54+ sudo mkfs.ext4 /dev/sda4
55+ mount_partition
56+ sudo chmod 777 /my_mount
57+
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # DISCLAIMER:
4+ # Script taken from http://askubuntu.com/questions/201937/ubuntu-detect-4-cpus-and-i-have-only-2-cpus
5+
6+
7+ echo " Disabling hyperthreading..."
8+
9+ CPUS_TO_SKIP=" $( cat /sys/devices/system/cpu/cpu* /topology/thread_siblings_list | sed ' s/[^0-9].*//' | sort | uniq | tr " \r\n" " " ) "
10+
11+ # Disable Hyperthreading
12+ for CPU_PATH in /sys/devices/system/cpu/cpu[0-9]* ; do
13+ CPU=" $( echo $CPU_PATH | tr -cd " 0-9" ) "
14+ echo " $CPUS_TO_SKIP " | grep " $CPU " > /dev/null
15+ if [ $? -ne 0 ]; then
16+ echo 0 > $CPU_PATH /online
17+ fi
18+ done
19+
20+ lscpu | grep -i -E " ^CPU\(s\):|core|socket"
21+
Original file line number Diff line number Diff line change 1+ sudo cpupower frequency-set -g performance
You can’t perform that action at this time.
0 commit comments