Skip to content

Commit

Permalink
Set up Noble
Browse files Browse the repository at this point in the history
  • Loading branch information
wizawu committed Jun 26, 2024
1 parent bd0b0f7 commit 9408f6e
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 74 deletions.
21 changes: 3 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,10 @@
default: install clean
all: apt ssh install clean

apt:
apt-key adv --keyserver keyserver.ubuntu.com --recv 04EE7237B7D453EC
echo "deb https://mirrors.cloud.tencent.com/debian bookworm main" > /etc/apt/sources.list
apt update
apt install -y ansible openssh-client openssh-server sudo
echo > /etc/apt/sources.list

ssh:
rm -f ~/.ssh/id_rsa
ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
ssh -o "StrictHostKeyChecking=no" [email protected] echo ok
clean:
apt autoremove --purge -y
apt clean -y

install:
ansible-playbook -b -e user=wizawu -v install.yml

clean:
apt autoremove --purge -y
apt clean -y

swap:
echo 60 >> /proc/sys/vm/swappiness
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
### Install


```bash
# edit /etc/network/interfaces
auto lo
Expand All @@ -7,15 +9,20 @@ iface wlan0 inet dhcp
wpa-ssid ssid
wpa-psk password

# run scripts
# run as root
ifup wlan0
apt install git make
git clone --depth 1 https://github.com/wizawu/sysconf.git /home/wizawu/.sysconf
echo "deb http://mirrors.aliyun.com/ubuntu noble main restricted universe multiverse" > /etc/apt/sources.list
apt-get update
apt-get install git make ansible openssh-client openssh-server sudo
echo > /etc/apt/sources.list

# git clone this repository to /home/wizawu/.sysconf
cd /home/wizawu/.sysconf
make all
make install clean
```

### Disable GUI

```bash
# edit /etc/default/grub
GRUB_CMDLINE_LINUX="text"
Expand All @@ -25,6 +32,7 @@ systemctl set-default multi-user.target
```

### Fix Intel Iris Xe graphics

```bash
# change the following line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="splash quiet nomodeset"
Expand All @@ -35,6 +43,7 @@ update-grub
```

### Enable more cpufreq governors (than powersave and performance)

```bash
# modify the following line in /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="... intel_pstate=disable"
Expand Down
7 changes: 2 additions & 5 deletions etc/apt/sources.list.d/default.list
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/debian bookworm stable
deb [arch=amd64] https://mirrors.cloud.tencent.com/debian bookworm main contrib non-free non-free-firmware
deb [arch=amd64] https://mirrors.cloud.tencent.com/ubuntu jammy main universe
deb [arch=amd64] https://mirrors.cloud.tencent.com/ubuntu mantic main universe
deb https://community-packages.deepin.com/deepin apricot main contrib non-free
deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu noble stable
deb [arch=amd64] http://mirrors.tuna.tsinghua.edu.cn/ubuntu noble main restricted universe multiverse
32 changes: 7 additions & 25 deletions install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
keyserver: keyserver.ubuntu.com
id: "{{item}}"
with_items:
- 7EA0A9C3F273FCD8 # docker-ce
- 871920D1991BC93C # ubuntu mantic
- 7EA0A9C3F273FCD8 # docker
- E88979FB9B30ACF2 # chrome
- EB3E94ADBE1229CF # vscode

- name: install apt packages
Expand Down Expand Up @@ -76,7 +76,6 @@
- hdparm
- hsetroot
- im-config
- ipad-charge
- lftp
- lm-sensors
- locate
Expand All @@ -85,7 +84,6 @@
- m4
- make
- manpages-dev
- netcat
- nethogs
- network-manager
- nfs-common
Expand All @@ -99,9 +97,6 @@
- psmisc
- pulseaudio
- putty-tools
- python3-pip
- python3.10-dev
- rcconf
- rinetd
- rlwrap
- rsync
Expand All @@ -122,29 +117,19 @@
- name: check built-in tools
shell: command -v {{item}}
with_items:
- curl
- getconf
- hwclock
- ipcs
- losetup
- lscpu
- lsusb
- pmap
- trap

- name: install database packages
apt:
name:
- mydumper
- postgresql-client
- redis-tools
- sqlite3

- include: tasks/command.yml
- include: tasks/desktop.yml
- include: tasks/vscode.yml
- include: tasks/pip.yml
- include: tasks/npm.yml
- include_tasks: tasks/command.yml
- include_tasks: tasks/desktop.yml
- include_tasks: tasks/vscode.yml
- include_tasks: tasks/pip.yml
- include_tasks: tasks/npm.yml

- name: create etc directories
file: dest=/{{item}} state=directory recurse=yes
Expand Down Expand Up @@ -214,9 +199,6 @@
- { key: "HandleLidSwitch", value: "ignore" }
- { key: "HandlePowerKey", value: "suspend" }

- name: disable grp:alt_shift_toggle
shell: sed -i -e 's/grp:alt_shift_toggle,\?//g' /etc/default/keyboard

- name: configure kernel parameters
sysctl:
name: "{{item.name}}"
Expand Down
11 changes: 6 additions & 5 deletions tasks/command.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
- name: install cli tools
apt:
name:
# FIXME hwclock
- ack-grep
- apt-file
- autossh
Expand All @@ -9,6 +10,7 @@
- cmatrix
- cpufrequtils
- cpulimit
- curl
- dconf-cli
- di
- docker-ce
Expand All @@ -26,8 +28,12 @@
- mtr
- nethogs
- npm
- postgresql-client
- pv
- python3-pip
- rar
- redis-tools
- sqlite3
- time
- tmux
- tree
Expand All @@ -51,8 +57,3 @@
- git-archive-file
- git-authors
- git-commits-since

- name: download antlr4
get_url:
url: https://www.antlr.org/download/antlr-4.9.3-complete.jar
dest: /usr/share/java/antlr-complete.jar
11 changes: 2 additions & 9 deletions tasks/desktop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@
- redshift
- smplayer
- tilix
- vim-gtk
- wireshark-gtk
- vim-gtk3
- x11-xkb-utils
- x11-xserver-utils
- xdg-desktop-portal
Expand Down Expand Up @@ -66,12 +65,6 @@
install_recommends: true
name:
- cinnamon-session
- cinnamon-settings
- cinnamon-control-center
- nautilus
- network-manager-gnome

- name: disable deepin-devicemanager-server
service: name=deepin-devicemanager-server state=stopped enabled=false

- name: remove nemo-desktop
shell: mv /usr/bin/nemo-desktop /usr/bin/.nemo-desktop
4 changes: 0 additions & 4 deletions tasks/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@
- n@latest
- [email protected]
- [email protected]
- [email protected]

- name: switch node version
shell: "n 18"
5 changes: 1 addition & 4 deletions tasks/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,9 @@
- name: install python packages
pip:
name:
- ansible-lint==5.0.7
- ansible==2.9.9
- black==20.8b1
- docker==4.2.1
- isort==5.7.0
- mycli==1.24.1
- wheel==0.36.2
- yq==2.13.0
executable: pip3
extra_args: --break-system-packages

0 comments on commit 9408f6e

Please sign in to comment.