Skip to content

Instantly share code, notes, and snippets.

@koji
Created April 17, 2017 21:03
Show Gist options
  • Save koji/d9e46ce64b9e5db2cd307c731316e79a to your computer and use it in GitHub Desktop.
Save koji/d9e46ce64b9e5db2cd307c731316e79a to your computer and use it in GitHub Desktop.
# Make a new user and add the new user to sudo group
$ sudo adduser username
$ sudo adduser username sudo
$ sudo vim /etc/sudoers
#pi ALL=(ALL) NOPASSWD: ALL
$ sudo awk -F: '($2 == "") {print}' /etc/shadow
# add a password to user who doesn't have it
$ sudo passwd -l username
# only root can have UID 0
$ sudo awk -F: '($3 == "0") {print}' /etc/passwd
# make the root disable
sudo passwd -l root
# delete pi user
$ sudo deluser --remove-home pi
# get a list of installed packages
$ dpkg --get-selections
# get rid of software
# LXDE
$ sudo apt-get remove --purge lxappearance lxde-common lxde-icon-theme lxinput lxmenu-data lxpanel lxpanel-data lxpolkit lxrandr lxsession lxsession-edit lxshortcut lxtask lxterminal
# X Windows
$ sudo apt-get remove --purge xserver-xorg xserver-xorg-input-all xserver-xorg-input-evdev xserver-xorg-input-synaptics xserver-common xserver-xorg-core xserver-xorg-video-fbdev xserver-xorg-video-fbturbo x11-common x11-utils x11-xkb-utils x11-xserver-utils xarchiver xauth weston ttf-dejavu-core xkb-data fontconfig fontconfig-config fonts-freefont-ttf gnome-themes-standard-data gstreamer1.0-alsa gstreamer1.0-libav gstreamer1.0-omx gstreamer1.0-plugins-base dbus-x11
# wireless programs
$ sudo apt-get remove --purge wireless-tools wpasupplicant
# Samba
$ sudo apt-get remove --purge smbclient samba-common
# Audio
$ sudo apt-get remove --purge alsa-base alsa-utils
#python
$ sudo apt-get remove --purge python python-gi python-minimal python-numpy python-picamera python-pifacecommon python-pifacedigitalio python-rpi.gpio python-serial python-support python2.7 python2.7-minimal python3 python3-minimal python3-numpy python3-picamera python3-pifacecommon python3-pifacedigital-scratch-handler python3-pifacedigitalio python3-rpi.gpio python3-serial python3.2 python3.2-minimal
# git
$ sudo apt-get remove --purge git git-core git-man
# other
$ sudo apt-get remove --purge smartsim minecraft-pi penguinspuzzle udisks freepats ed vim-common vim-tiny java-common
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment