本指南适用于Ubuntu,但也与其他基于Debian的操作系统兼容,例如Mint,Elementary OS等。
还有其他版本的配置,例如20.04,18.04,16.04,15.10
测试了所有命令/配置(我当前正在使用此配置),但是无论如何,您所做的一切都是“自身风险”。
如果您发现任何问题,请在问题页面上或通过电子邮件[email protected]告诉我
(返回到顶部)
lsb_release -a
lsb_release -as # Short Information
lsb_release -sc # OS Codename
lsb_release --help
sudo dmidecode -t processor
或者
nproc # How many Processing Units
cpuid # Must install cpuid from terminal
cat /proc/cpuinfo # Lots of info
sudo lshw -C display
sudo dmidecode -t baseboard
sudo dmidecode -t bios
free -h # Human readable, or do --help for options
top or htop # Must install htop
vmstat -s
cat /proc/meminfo # Lots of info
磁盘空间
df
df -B MB # In Megabtyes, etc
或安装ncdu并运行
ncdu /
磁盘空间分析仪
sudo baobab
磁盘UUID
ls -al /dev/disk/by-uuid/
gnome-system-monitor
您可以通过在终端中输入以下命令来确定哪种服务需要多少时间才能完成:
systemd-analyze blame
总体启动时间您可以通过以下方式找到:
systemd-analyze time
列出所有已安装的软件包
dpkg -l
仅列出明确安装的软件包
aptitude search '~i!~M'
从终端运行以下屏幕截图:
gnome-screenshot
延迟5秒
gnome-screenshot --delay 5
延迟5秒,只有窗口
gnome-screenshot -w --delay 5
要更改GNOME-SCREENSHOT的默认保存目录,请使用命令
gsettings set org.gnome.gnome-screenshot auto-save-directory "file:///home/$USER/Pictures/"
awk '{print $1*10^-6 " W"}' /sys/class/power_supply/BAT0/power_now
另外,您可以安装powertop以列出每个过程的消耗。
sudo apt install powertop
首次使用之前,您可能需要校准powertop 。对于校准,运行:
sudo powertop --calibrate
gsettings list-recursively org.gnome.desktop.wm.keybindings | sort | more
查看您的关键:
xev
或有关许多细节:
xev | grep KeyPress
如果愿意,您可以使用32位应用程序,有时这很有用。
sudo apt update && sudo apt install -y unetbootin
要启用网络,并使Windows等所有计算机都可以访问它,请首先安装Samba:
$ sudo apt install -y samba
然后编辑Samba配置:
$ vim /etc/samba/smb.conf
在[global]下,将工作组更改为您使用的内容,默认值为工作组:
workgroup = WORKGROUP
然后,您将必须重新加载会话。
如果您正在运行GRUB作为默认启动加载程序,则可以使用此应用程序来更容易更改订单。
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer
sudo apt update && sudo apt install -y grub-customizer
加载应用程序<Super> ,并查找GRUB定制器或终端gksudo grub-customizer 。
转到General Settings选项卡,您将看到默认条目。
打开 /etc /fstab
sudo vim /etc/fstab
添加到/etc/fstab此行(您可以通过命令ls -al /dev/disk/by-uuid/ )获得磁盘uuid:
对于NTFS磁盘:
UUID=[DISK UUID] /media/D ntfs-3g defaults,windows_names,locale=en_US.utf8 0 2
对于Ext4磁盘:
UUID=[DISK UUID] /media/D ext4 defaults 0 2
运行后
sudo mount -a
打开 /etc /fstab
sudo vim /etc/fstab
并添加:
如果需要授权:
username@remote_address:/remote/path /local/path fuse.sshfs delay_connect,_netdev,idmap=user,uid=1000,gid=1000,noatime,default_permissions,IdentityFile=/home/<user>/.ssh/id_rsa,reconnect,transform_symlinks,allow_other 0 0
如果不需要:
//remote_address/remote/path /local/path cifs guest,iocharset=utf8,uid=1000,gid=1000,file_mode=0777,dir_mode=0777,noperm,_netdev 0 0
运行后
sudo mount -a
安装先决条件
sudo apt install -y python3 python3-appdirs python3-dateutil python3-requests python3-sqlalchemy python3-pip
安装acd_cli(https://github.com/yadayada/acd_cli)
cd ~ && sudo pip3 install --upgrade git+https://github.com/yadayada/acd_cli.git
启动“同步”,该“同步”将启动浏览器(Chrome/lynx/etc)向Amazon.com启动并设置OAuth键。
acd_cli sync
复制/粘贴并存储您的OAuth数据。注意:它很可能会出现不当的纽线休息时间。在您喜欢的文本编辑器中进行修复。
vim ~/.cache/acd_cli/oauth_data
将用户添加到“保险丝”组中以允许安装
sudo addgroup <username> fuse
将Amazon Cloud Drive的根部安装到 /媒体 /Amazon目录
mkdir /media/amazon
acd_cli mount /media/amazon
上传
-d exclude duplicate files from upload
-x upload threads
例如,将本地 /媒体 /视频目录上传到Amazon Cloud Drive的根部。
acd_cli upload -d -x 4 /media/videos /
ssh-keygen -t rsa -C "[email protected]"
ssh [email protected] (default port is 22)
ssh [email protected] -p 8000 (connect to specific port)
ssh [email protected] -i ~/.ssh/id_rsa (connect with specific ssh key)
chmod 700 ~/.ssh
chmod 644 ~/.ssh/id_rsa.pub
chmod 600 ~/.ssh/id_rsa
chmod 600 ~/.ssh/known_hosts
chmod 600 ~/.ssh/authorized_keys
您还可以创建一个〜/.ssh/config文件和存储条目,例如:
Host aws
Hostname host.amazonaws.com
Port 22
Identityfile ~/.ssh/id_rsa
User myusername
Host my-vps
Hostname 34.16.67.129
Port 22
User root
然后,您可以简单地键入:
ssh aws
ssh my-vps
有时您可能需要PEM格式SSH键。您可以轻松地将其与其他SSH键一起添加。
openssl rsa -in ~/.ssh/keyname_rsa -outform pem > keyname_rsa.pem
chmod 700 keyname_rsa.pem
打开终端和类型:
gpg --gen-key
GPG现在将询问有关要生成的密钥类型的许多问题。请按照以下步骤每次选择默认选项。
检查您的密钥是否已通过键入生成
gpg --list-secret-keys --keyid-format LONG
而且,如果成功
/Users/hubot/.gnupg/secring.gpg
------------------------------------
sec 4096R/3AA5C34371567BD2 2016-03-10 [expires: 2017-03-10]
uid Hubot
ssb 4096R/42B317FD4BA89E7A 2016-03-10
在您的.bashrc中添加变量
export GPGKEY=3AA5C34371567BD2
gpg --output gpg.asc --export -a $GPGKEY
gpg --send-keys --keyserver keyserver.ubuntu.com $GPGKEY
您可以在http://keyserver.ubuntu.com/上检查键
要配置您的git客户端以默认为本地存储库签名,在git Versions 2.0.0及更高版本中
git config --global user.signingkey {YOUR KEY}
git config commit.gpgsign true
要默认在计算机上的任何本地存储库中签署所有提交,请运行
git config --global commit.gpgsign true
如果您想手动签名:
git commit -S -m "commit message"
如果要使用GUI客户端进行投入,则必须在~/.gnupg/gpg.conf文件中添加一些选项
no-tty
use-agent
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
# or, instead of backing up trustdb...
gpg --export-ownertrust > ownertrust-gpg.txt
cp /path/to/backups/*.gpg ~/.gnupg/
# or, if you exported the ownertrust
gpg --import-ownertrust ownertrust-gpg.txt
如果您只是复制了.gnupg文件夹,则应注册键:
gpg --import pubring.gpg
gpg --import secring.gpg
检查是否得到硬件的支持
egrep -c '(vmx|svm)' /proc/cpuinfo
如果0表示您的CPU不支持硬件虚拟化。
如果1或更多,则仍然需要确保在BIOS中启用虚拟化。
要检查是否已启用,您可以执行:
kvm-ok
如果您有KVM,则会看到:“信息:您的CPU支持KVM扩展信息: /dev /kvm存在KVM加速度,可以使用”
安装必要的软件包
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils
如果您遇到了错误:libdvd-pkg: apt-get check失败,则包裹可能损坏。流产...
您必须运行sudo dpkg-reconfigure libdvd-pkg ,然后重试。
接下来,将您的用户添加到KVM组和Libvirtd组中。为此,输入:
sudo adduser `id -un` libvirt
sudo adduser `id -un` kvm
验证安装:
virsh list --all
输入sudo模式
sudo su
列出可用的磁盘并检测其安装位置: /dev /sd [1个字母] [可选的1个数字]。例如, /dev /sdc或 /dev /sdc1
fdisk -l
或者
lsblk
卸载驱动器
umount /dev/sd[1 letter][optionally 1 number]
格式为FAT32
mkfs.vfat /dev/sd[1 letter]
您可以将mkfs.ntfs用于NTF,MKFS.ext4用于Ext4等。
弹出驱动器
eject /dev/sd[1 letter]
列出可用的磁盘并检测其安装位置: /dev /sd [1个字母] [可选的1个数字]。例如, /dev /sdc或 /dev /sdc1
fdisk -l
或者
lsblk
如果您想在USB上写入Windows ISO,请使用以下方法:Linux上的Windows ISO的USB Maker
确保USB设备已卸载(不安全地卸下,但要卸载),如果安装它,则可以卸载它:
sudo umount /dev/sd[1 letter][optionally 1 number]
用于编写图像运行:
sudo dd bs=4M if=path/to/your/iso/file.iso of=/dev/sd[that 1 letter]
安装genisoimage
sudo apt install -y genisoimage
跑步后
geteltorito -o dest.img source.iso
您必须安装HPLIP软件。在https://developers.hp.com/hp-linux-imaging-and-printing上了解更多信息
sudo apt install hplip hplip-gui
查找安装的HP应用程序并运行。
您可以通过BIOS信息命令查看BIOS版本
通过sudo apt install genisoimage
转到support.lenovo.com(或更好地使用搜索引擎,因为Lenovo网站很丑)并搜索笔记本电脑型号的BIOS升级。
下载最新的ISO文件。查找“ BIOS可启动更新CD”。
通过genisoimage -o bios.img g2uj18us.iso将.ISO转换为.img格式,将ISO映像转换为IMG格式
将任何USB插入笔记本电脑中插入。图像文件的尺寸仅约50 MB,因此即使容量较低的USB棒也可以工作。请记住,棍子将被完全覆盖。
如果您在图形环境中,请卸载USB棒。
找出棍棒的设备名称。例如/dev/sdb (通过sudo fdisk -l显示设备)。不要只是假设它是SDB。如果它在笔记本电脑上的另一个设备上,则将破坏数据。
将图像复制到USB棒: sudo dd if=bios.img of=/dev/sdb bs=1M
重新启动笔记本电脑,然后按F12从棍棒上启动设备。
确保您的笔记本电脑插入电源。(否则将拒绝更新。)
按照说明进行操作。
BetterCap是一种功能强大,灵活和便携式工具,可实时对网络,操纵HTTP,HTTPS和TCP流量进行各种类型的MITM攻击,嗅探凭据等等。完整的文档https://www.bettercap.org
安装依赖项
sudo apt install -y build-essential ruby-dev libpcap-dev
并安装BetterCap
sudo gem install bettercap
您可以通过
sudo bettercap --sniffer
安装paprefs软件包
sudo apt install -y paprefs
转到PulseAudio Preferences ,并在Simultaneous Output卡上查看Add virtual output device for simultaneous output on all local sound cards
此后重新启动脉冲
pulseaudio -k
然后转到您的声音设置,您将看到输出到多个声音设备的选项。
将文件ps.sh放在/etc/profile.d目录下。
在〜/.bashrc和/root/.bashrc文件中添加行:
source /etc/profile.d/ps.sh
安装cpufrequtils并设置州长
sudo apt install -y cpufrequtils
echo 'GOVERNOR="performance"' | sudo tee /etc/default/cpufrequtils
sudo systemctl restart cpufrequtils
禁用默认ondemand总督:
sudo systemctl disable ondemand
您可以通过
cpufreq-info
或者:
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
以下步骤将向您显示一个示例bash脚本,该脚本报告/home目录的磁盘空间使用情况,并每次Ubuntu System启动时将报告保存在/root目录中。
在/usr/local/bin/中创建shell脚本以在启动时运行。
vim /usr/local/bin/disk-space-check.sh
以下是此类脚本的一个示例:
#! /bin/bash
date > /root/disk_space_report.txt
du -sh /home/ >> /root/disk_space_report.txt在/etc/systemd/system/文件夹下创建SystemD服务文件。
sudo vim /etc/systemd/system/disk-space-check.service
并放置内容:
[Unit]
After=network.service
[Service]
ExecStart=/usr/local/bin/disk-space-check.sh
[Install]
WantedBy=multi-user.target
设置适当的许可:
sudo chmod 744 /usr/local/bin/disk-space-check.sh
sudo chmod 664 /etc/systemd/system/disk-space-check.service
启用服务单元:
sudo systemctl daemon-reload
sudo systemctl enable disk-space-check.service
Systemd有用的命令:
systemctl list-units --type=service列表现有服务systemctl list-units --type=target列表可能的目标systemctl list-dependencies <name>.target列表依赖项对于更现代化的系统(> 1GB),您的交换空间应至少等于您的物理内存(RAM)大小“如果使用Hibernation”,否则最少需要圆形(SQRT(RAM)),最多是RAM的两倍。拥有比实际使用的交换空间更多的唯一缺点是您将为它保留的磁盘空间。您可以在这里阅读更多。
检查交换
cat /proc/swaps
交换参数控制内核将过程从物理内存中移出并转移到交换磁盘上的趋势。由于磁盘比RAM慢得多,因此,如果过程过于积极地移出内存,则可以导致系统和应用程序响应时间较慢。
Ubuntu中的默认设置为交换= 60。减少交换的默认值可能会改善典型的Ubuntu桌面安装的整体性能。建议使用= 10的值,但可以随意进行实验。
检查交换价值
cat /proc/sys/vm/swappiness
以10的交换价值为10,可以用10来改变交换价值
sudo vim /etc/sysctl.conf
并添加/编辑行
vm.swappiness=10
假设您的字体在~/Download/Fonts下
要添加这些字体,您必须运行:
sudo mkdir /usr/share/fonts/truetype/custom
sudo mv /home/longman/Downloads/Fonts/*.TTF /usr/share/fonts/truetype/custom
sudo mkdir /usr/share/fonts/opentype/custom/
sudo mv /home/longman/Downloads/Fonts/*.otf /usr/share/fonts/opentype/custom
要清除缓存,请运行:
fc-cache -rv
(返回到顶部)
登录到Linux用户,然后转到您的主目录,
cd ~
运行这些命令并根据需要调整它们。 -y标志在没有提示的情况下安装。从终端运行这些命令。
sudo apt update && sudo apt upgrade
在下面的类别中提供了PPA,我强烈建议您使用PPA或至少安装此软件包,以防您使用它们。
启用规范合作伙伴存储库
sudo add-apt-repository -y "deb http://archive.canonical.com/ $(lsb_release -sc) partner" && sudo apt update
Flatpak是用于在Linux上构建和分发桌面应用程序的下一代技术
sudo apt install -y flatpak gnome-software-plugin-flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
并重新启动系统。
这是为了调整UI
sudo apt update && sudo apt install -y
gnome-tweak-tool
chrome-gnome-shell
gnome-shell-extensions
dconf-editor
synaptic
您可以检查您的VGA信息
在https://www.nvidia.com/en-us/geforce/geforce/drivers/上找到适合您图形卡的正确驱动程序版本
安装NVIDIA驱动程序
sudo add-apt-repository -y ppa:graphics-drivers/ppa
sudo apt update && sudo apt install -y nvidia-driver-XXX
键入您的版本xxx
然后从驱动程序选项卡中选择安装的驱动程序后
sudo software-properties-gtk
卸下NVIDIA驱动程序
sudo add-apt-repository -r ppa:graphics-drivers/ppa
编辑NVIDIA设置;在Global Launcher (超键/Windows键)中键入以下内容:
nvidia settings
NVIDIA®CUDA®工具包为创建高性能GPU加速应用提供了一个开发环境。
该工具包包括GPU加速库,调试和优化工具,C/C ++编译器以及用于部署应用程序的运行时库。
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository -y "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt update
sudo apt -y install cuda
要安装ATI驱动程序,请阅读此官方文档:http://support.amd.com/en-us/kb-articles/pages/amdgpu-pro-install.aspx
安装实用程序:
sudo apt install -y vim git mercurial meld curl htop xclip unzip gdebi preload bleachbit ubuntu-restricted-extras cifs-utils unace unrar zip p7zip-full
p7zip-rar sharutils rar openssh-server lm-sensors whois traceroute nmap font-manager sshfs mc libavcodec-extra libdvd-pkg nfs-kernel-server openvpn
easy-rsa network-manager-openvpn-gnome exfat-fuse apt-transport-https ethtool net-tools dos2unix
liblz4-tool network-manager-openconnect-gnome network-manager-fortisslvpn-gnome openfortivpn tree duplicity screen lib32z1
libglib2.0-dev-bin pv software-properties-common cpu-checker libnss3-tools python3-pip libcanberra-gtk-module sshpass jq libfuse2 libxi6 libxrender1
libxtst6 mesa-utils libfontconfig libgtk-3-bin tar dbus-user-session libminizip1 libgdk-pixbuf-xlib-2.0-0 libgdk-pixbuf2.0-0 libopenal-data libopenal1
libsndio7.0 gnome-shell-extension-manager bpytop ca-certificates-java cargo clang clang-18 default-jdk default-jdk-headless default-jre default-jre-headless
fonts-dejavu-extra icu-devtools java-common lib32gcc-s1 lib32stdc++6 libatk-wrapper-java libatk-wrapper-java-jni libc6-x32 libclang-common-18-dev libclang-rt-18-dev
libgit2-1.7 libhttp-parser2.9 libice-dev libicu-dev libobjc-13-dev libobjc4 libpfm4 libsm-dev libstd-rust-1.75 libstd-rust-dev libxml2-dev libxt-dev libz3-4 libz3-dev
linux-headers-generic llvm-18 llvm-18-dev llvm-18-linker-tools llvm-18-runtime llvm-18-tools openjdk-21-jdk openjdk-21-jdk-headless openjdk-21-jre openjdk-21-jre-headless
p7zip python3-gpg python3-ldb python3-markdown python3-psutil python3-samba python3-talloc python3-tdb rustc samba-common samba-common-bin samba-dsdb-modules putty-tools
设置GIT默认值
git config --global user.name "your name"
git config --global user.email "[email protected]"
这将与以下方式创建一个~/.gitconfig
[user]
email = [email protected]
name = your name
Ubuntu 20.04带有新的深色主题选项,但这还不够。
在设置中>外观选择窗口颜色为深色。
“问题”源于新的“黑暗”设置只会改变桌面上运行的应用的外观。它不会改变桌面UI本身的颜色。要解决此问题,请安装用户主题GNOME SHELL EXTENSION和GNOME调整工具:
sudo apt install -y gnome-shell-extensions gnome-tweak-tool
打开Gnome扩展应用程序,然后将“用户主题”旁边的切换滑到ON。
重新启动Gnome shell(alt + f2,type r,命中输入)
最后,打开GNOME调整工具,然后在侧边栏中选择“外观”,找到外壳部分,然后从相邻的菜单中选择Yaru Dark 。
从https://www.oracle.com/java/technologies/javase-jdk15-downloads.html下载并安装DEB软件包
并更新替代方案
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk-15.0.1/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk-15.0.1/bin/javac 1
sudo update-alternatives --config java
运行Windows应用程序是最佳选择。我经常将Heidisql与葡萄酒一起使用。
启用i386架构
sudo dpkg --add-architecture i386
下载并添加存储库密钥:
wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
添加存储库:
sudo add-apt-repository -y 'deb https://dl.winehq.org/wine-builds/ubuntu/ focal main'
安装:
sudo apt update && sudo apt install -y --install-recommends winehq-stable
使用Nautilus-Actions轻松且图形地创建Ubuntu的Nautilus文件管理器的自定义上下文菜单选项。
sudo add-apt-repository -y ppa:daniel-marynicz/filemanager-actions
sudo apt install -y filemanager-actions-nautilus-extension
安装后,请使用以下命令退出并重新启动Nautilus文件管理器。您也可以按Alt+F2并键入此命令,而不是在终端中运行它。
nautilus -q
安装后,您可以启动fma-config-tool 。
您还可以安装一些Nautilus扩展名
sudo apt install -y nautilus-admin nautilus-meld nautilus-checksum-menu
Hardinfo是Linux的珠穆朗玛峰/AIDA替代方案。它显示系统信息
sudo apt install -y hardinfo
咖啡因是使用全屏窗口时暂时防止屏幕保护程序 /锁定屏幕 /睡眠模式激活的工具。如果您使用的是不自动执行此操作的视频播放器,在听音乐时,该应用程序很有用。
sudo apt install -y caffeine
注意:安装后,咖啡因的命令行版本设置为在登录时自动启动。如果您希望指示器自动启动,则必须在启动应用程序中添加“咖啡因 - 探测器”。
屏幕是一个全屏窗口管理器,它在几个过程(通常是交互式外壳)之间多路复用物理终端。每个虚拟终端都提供DEC VT100终端的功能,此外,ANSI X3.64(ISO 6429)和ISO 2022标准(例如,插入/删除行和支持多个字符集)的几个控制函数。每个虚拟终端都有一个滚动记录缓冲区,并且有一个复制和贴上机制,该机制使用户可以在Windows之间移动文本区域。当屏幕被称为屏幕时,它将创建一个带有外壳(或指定命令)的单个窗口,然后避开您的方式,以便您可以像往常一样使用程序。然后,您可以随时使用其中的其他程序(包括更多的外壳)创建新的(全屏)窗口,杀死当前窗口,查看活动窗口的列表,打开和关闭输出登录,在Windows之间复制文本,在Windows之间复制文本,查看滚动记录,在Windows之间进行切换,在Windows之间进行切换等。所有Windows都完全独立于他们的程序。当目前看不到其窗口时,即使整个屏幕会话都与用户终端分离时,程序仍将继续运行。
sudo apt install -y screen
快速,高度可自定义的系统信息脚本
Neofetch是用Bash编写的CLI系统信息工具。 NeoFetch显示有关您的系统的信息,您选择的图像,OS徽标或任何ASCII文件。 NeoFetch的主要目的是用于屏幕截图,以向其他用户展示您正在运行的操作系统,您使用的主题/图标等。
安装:
sudo apt install -y neofetch
图形管理磁盘分区的分区编辑器https://gparted.sourceforge.io/
sudo apt install -y gparted
UFW或简单的防火墙是Iptables的接口,旨在简化配置防火墙的过程。虽然iptables是一种坚实而灵活的工具,但对于初学者来说,很难学习如何使用它来正确配置防火墙。 UFW默认是在Ubuntu上安装的。如果由于某种原因卸载了它,您可以将其安装
sudo apt install -y ufw
要启用UFW,请使用此命令:
sudo ufw enable
配置示例:
要配置服务器以允许传入的SSH连接,您可以使用此命令:
sudo ufw allow ssh
但是,我们实际上可以通过指定端口而不是服务名称来编写等效规则。例如,此命令与上面的命令相同:
sudo ufw allow 22
例如,要允许使用端口6000-6007的X11连接,请使用以下命令:
sudo ufw allow 6000:6007/tcp
sudo ufw allow 6000:6007/udp
GUFW是UFW的GUI
sudo apt install -y gufw
从https://www.geekbench.com/download/linux/下载档案。
在 /OPT下移动文件夹
sudo mv Geekbench-5.3.1-Linux /opt/geekbench5
现在您可以运行基准
/opt/geekbench5/geekbench5
Clonezilla是一个分区和磁盘成像/克隆程序。它可以帮助您进行系统部署,裸机备份和恢复。
下载实时USB映像:https://clonezilla.org/downloads/download.php?branch=stable
准备USB设备
mkfs.vfat -F 32 /dev/sd[1 letter]
并将ISO图像写给USB
这是一个测试CRT/LCD屏幕质量的程序。它显示了各种模式,并允许您估计CRT/LCD显示器的质量。
sudo apt install -y screentest
Ventoy是为ISO/WIM/IMG/VHD(X)/EFI文件创建可引导USB驱动器的开源工具。使用Ventoy,您无需一遍又一遍地格式化磁盘,您只需要将ISO/WIM/IMG/VHD(X)/EFI文件复制到USB驱动器并将其直接启动即可。您可以一次复制许多文件,而Ventoy将为您提供启动菜单以选择它们。
从此处下载安装程序包,例如Ventoy-XXXX-Linux.tar.gz并进行解压缩。将shell脚本作为root运行,其中xxx是USB设备,例如 /dev /sdb:
sudo sh Ventoy2Disk.sh -i -L "MY-USB" /dev/XXX
注意将要格式化USB驱动器,并且安装后所有数据将丢失。
您只需要一次安装Ventoy,然后所有需要的就是将ISO文件复制到USB。您也可以将其用作普通的USB驱动器来存储文件,这不会影响Ventoy的功能。
您可以在USB驱动器上使用配置文件/ventoy/ventoy.json配置Ventoy的工作方式。
我的配置文件看起来像:
{
"control" : [
{ "VTOY_DEFAULT_SEARCH_ROOT" : " /install/iso " }
],
"theme" : {
"display_mode" : " CLI "
}
}您可以在这里找到完整的文档
(返回到顶部)
添加Google Chrome存储库并安装
sudo sh -c 'echo "deb [arch=amd64] http://dl-ssl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update && sudo apt install -y google-chrome-stable
然后以$ google-chrome启动它,您可以将其固定在侏儒酒吧中。
通过快照安装:
sudo snap install firefox
安装
sudo apt install playonlinux
安装
sudo apt install nautilus-dropbox
代码,标记和散文的复杂文本编辑器
添加存储库:
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
sudo apt install apt-transport-https
稳定版本:
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
开发版本:
echo "deb https://download.sublimetext.com/ apt/dev/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
安装:
sudo apt update && sudo apt install -y sublime-text
此处解释的设备之间同步的配置
安装
sudo apt -y install pidgin
配置Google Talk帐户
基本的
先进的
从http://dbeaver.jkiss.org/download/下载
VirtualBox是一种功能强大的X86和AMD64/Intel64虚拟化产品,用于企业以及家庭使用。
在https://www.virtualbox.org/wiki/linux_downloads上查看最新版本号
在编写本手册时,最新版本为7.0
安装
sudo sh -c 'echo "deb [arch=amd64 signed-by=/usr/share/keyrings/oracle-virtualbox-2016.gpg] https://download.virtualbox.org/virtualbox/debian $(lsb_release -sc) contrib" >> /etc/apt/sources.list.d/virtualbox.list'
wget -O- https://www.virtualbox.org/download/oracle_vbox_2016.asc | sudo gpg --yes --output /usr/share/keyrings/oracle-virtualbox-2016.gpg --dearmor
sudo apt-get update
sudo apt-get install virtualbox-7.0
如果您遇到错误,请先运行: sudo apt --fix-broken install
建议启用本地虚拟化
另外,您可以读取与虚拟机相关的
安装
我建议通过https://www.jetbrains.com/toolbox-app/安装JetBrains Toolbox,并从工具箱安装Android Studio。
下载Android SDK后,更新路径变量:
vim ~/.bashrc
添加行:
export PATH=${PATH}:/path-to-android-sdk/tools
export PATH=${PATH}:/path-to-android-sdk/platform-tools
从https://www.syntevo.com/smartgit/download/下载DEB Bundle
安装
sudo apt install -y filezilla
安装
sudo sh -c 'echo "deb http://repository.spotify.com testing non-free" >> /etc/apt/sources.list.d/spotify.list'
sudo apt update && sudo apt install -y spotify-client
从http://www.teamviewer.com/en/download/linux.aspx下载
sudo apt install -y meld
要安装Vagrant,您需要下载并运行安装套件。在进一步前进之前,请确保已安装DPKG和虚拟框:
sudo apt install -y dpkg-dev virtualbox-dkms
确保Linux标头已经安装
sudo apt install -y linux-headers-$(uname -r)
转到https://www.vagrantup.com/downloads.html vagrant的页面,并检查最新版本。在编写本手册时,最后一个版本为2.0.1
wget https://releases.hashicorp.com/vagrant/2.0.1/vagrant_2.0.1_x86_64.deb
sudo dpkg -i vagrant_2.0.1_x86_64.deb
重新配置VirtualBox DKM:
sudo dpkg-reconfigure virtualbox-dkms
安装
wget -qO- https://get.docker.com/ | sh
如果您的用户未正确配置,请与Docker合作会很痛苦,因此请使用以下命令将用户添加到Docker组中。
sudo usermod -aG docker $(whoami)
登录并从服务器登录以激活您的新组。
sudo apt install -y docker-compose
安装
sudo apt install -y audacious
XNView MP是XNView Classic的增强版本。它是功能强大的跨平台媒体浏览器,查看器和转换器。与PSD等500多个格式兼容
从http://www.xnview.com/en/xnviewmp/#downloads下载并安装
就像Google Keep和Windows Sticky Notes一样,您可以在桌面上记下思想,列表和提醒。
安装
sudo apt-add-repository ppa:umang/indicator-stickynotes
sudo apt update && sudo apt install -y indicator-stickynotes
Guake是为GNOME桌面环境制作的下拉终端。 Guake的窗口风格基于FPS游戏,其目标之一就是易于实现。
安装
sudo apt install -y guake
使用快照安装:
sudo snap install skype
使用快照安装:
sudo snap install telegram-desktop
使用快照安装:
sudo snap install slack
从https://www.viber.com/en/download/下载适应
创建应用程序文件夹,如果不存在的话: mkdir ~/applications
mv viber.AppImage ~/applications && chmod a+x ~/applications/viber.AppImage
执行~/applications/viber.AppImage
安装
sudo apt install -y gimp gimp-data gimp-plugin-registry gimp-data-extras
VLC是一种免费的开源跨平台多媒体播放器和框架,它播放大多数多媒体文件以及DVD,音频CD,VCD和各种流媒体协议。
安装
sudo apt install -y vlc
使用快照安装:
sudo snap install kdenlive
您可以轻松地从终端中使用httpie: http get https://google.com
安装
sudo apt update && sudo apt install -y httpie
简单的动画GIF屏幕录音机,易于使用接口
安装
sudo add-apt-repository -y ppa:peek-developers/stable
sudo apt update && sudo apt install -y peek
免费和开源软件,用于视频录制和实时流媒体https://obsproject.com/。
安装
sudo add-apt-repository -y ppa:obsproject/obs-studio
sudo apt update && sudo apt install -y obs-studio
您可以轻松地使用Startup Disk Creator和UNetbootin来为USB创建Linux。但是,如果您需要从Linux OS创建Windows可启动USB,请使用Woeusb:
sudo add-apt-repository -y ppa:tomtomtom/woeusb
sudo apt install -y woeusb-frontend-wxgtk
敏捷和简洁建模的精致软件建模器(http://staruml.io/)
您可以从http://staruml.io/download下载。
使下载的文件可执行并运行。
Gramps是一个免费的软件项目和社区。这是一个族谱计划,既对业余爱好者来说都是直观的,又是专业家谱学家的完整特征。
要安装,运行:
sudo apt install -y gramps
Uget是一个强大的下载管理器。
要安装,运行:
sudo add-apt-repository -y ppa:uget-team/ppa
sudo apt install -y uget uget-integrator
您还可以安装浏览器扩展程序以进行UGET集成:
Xournal是一种GUI应用程序,主要用于记录和素描用例。顾名思义,当您保留日记本时,尤其是在具有触摸屏的笔记本电脑上时,Xournal是一个非常方便的工具。除此例外,Xournal实际上具有出色的PDF编辑功能,并且还可以导出修改后的PDF文件。
要安装,运行:
sudo apt install -y xournal
这是将签名图像添加到带有Xournal的PDF文档中的非常有用的工具。有两种方法可以将您的手写签名添加到Xournal的PDF文档中。您可以使用内置笔图直接绘制签名。另外,您可以使用另一个工具创建签名的图像文件,并使用Xournal将图像导入PDF文档。
要手工编写您的签名,请在Xournal的GUI菜单左上角单击Pen图标。您也可以通过单击Text图标来打印和键入任何内容(例如,日期)。要在Xournal上添加签名的图像,请单击Xournal GUI菜单顶部的Image图标,或转到菜单选项中的Tools → Image 。
变速箱设计用于易于使用。我们将默认设置设置为仅工作,只需单击几下即可配置高级功能,例如手表目录,不良的同行块列表和Web界面。当Ubuntu选择传输作为其默认的Bittorrent客户端时,最引用的原因之一是其易于学习曲线。
要安装,运行:
sudo apt install -y transmission
Linux的时移是一个应用程序,可提供类似于Windows中的系统还原功能和Mac OS中的Time机床的功能。时移可以通过定期进行文件系统的增量快照来保护您的系统。这些快照可以在以后还原以撤消对系统的所有更改。
要安装,运行:
sudo apt install -y timeshift
Libreoffice是一个免费的强大办公室套件,也是OpenOffice.org的继任者(通常称为OpenOffice)。它的干净界面和功能丰富的工具可帮助您释放创造力并提高生产力。
要安装,运行:
sudo apt install -y libreoffice
(返回到顶部)
Linux Apache mysql php
- 以下安装:
如果您想以后要编译任何附加组件,则必须安装PHP5.6-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php5.6 libpcre3-dev php5.6-cli php5.6-cgi php5.6-common php5.6-mysql php5.6-curl php5.6-gd php5.6-geoip php5.6-imagick php5.6-imap php5.6-json php5.6-ldap php5.6-mcrypt php5.6-memcache php5.6-memcached php5.6-tidy php5.6-xdebug php5.6-xmlrpc php5.6-xsl php5.6-dev
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php5-
如果要稍后再编译任何附加组件,则必须安装PHP7.0-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php7.0-bz2 php7.0-cgi php7.0-cli php7.0-common php7.0-curl php7.0-dev php7.0-enchant php7.0-fpm php7.0-gd php7.0-gmp php7.0-imap php7.0-intl php7.0-json php7.0-ldap php7.0-mcrypt php7.0-mysql php7.0-odbc php7.0-opcache php7.0-pgsql php7.0-phpdbg php7.0-pspell php7.0-readline php7.0-recode php7.0-sybase php7.0-tidy php7.0-xmlrpc php7.0-xsl php7.0-sqlite3 php7.0-mbstring php7.0-bcmath php7.0-soap php7.0-zip php-xdebug php-imagick
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php7.0-
如果要稍后再编译任何附加组件,则必须安装PHP7.4-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php7.4-bz2 php7.4-cgi php7.4-cli php7.4-common php7.4-curl php7.4-dev php7.4-enchant php7.4-fpm php7.4-gd php7.4-gmp php7.4-imap php7.4-intl php7.4-json php7.4-ldap php7.4-mysql php7.4-odbc php7.4-opcache php7.4-pgsql php7.4-phpdbg php7.4-pspell php7.4-readline php7.4-sybase php7.4-tidy php7.4-xmlrpc php7.4-xsl php7.4-sqlite3 php7.4-mbstring php7.4-bcmath php7.4-soap php7.4-zip php7.4-xdebug php7.4-redis php7.4-igbinary php7.4-imagick php-sodium
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php7.4-
如果要稍后再编译任何附加组件,则必须安装php8.0-dev 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php8.0-bz2 php8.0-cgi php8.0-cli php8.0-common php8.0-curl php8.0-dev php8.0-enchant php8.0-fpm php8.0-gd php8.0-gmp php8.0-imap php8.0-intl php8.0-ldap php8.0-mysql php8.0-odbc php8.0-opcache php8.0-pgsql php8.0-phpdbg php8.0-pspell php8.0-readline php8.0-sybase php8.0-tidy php8.0-xmlrpc php8.0-xsl php8.0-sqlite3 php8.0-mbstring php8.0-bcmath php8.0-soap php8.0-zip php8.0-xdebug php8.0-redis php8.0-igbinary php8.0-imagick php-sodium
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php8.0-
如果要稍后再编译任何附加组件,则必须安装PHP8.1-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php8.1-bz2 php8.1-cgi php8.1-cli php8.1-common php8.1-curl php8.1-dev php8.1-enchant php8.1-fpm php8.1-gd php8.1-gmp php8.1-imap php8.1-intl php8.1-ldap php8.1-mysql php8.1-odbc php8.1-opcache php8.1-pgsql php8.1-phpdbg php8.1-pspell php8.1-readline php8.1-sybase php8.1-tidy php8.1-xmlrpc php8.1-xsl php8.1-sqlite3 php8.1-mbstring php8.1-bcmath php8.1-soap php8.1-zip php8.1-xdebug php8.1-redis php8.1-igbinary php8.1-imagick
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php8.1-
如果要稍后再编译任何附加组件,则必须安装PHP8.2-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt update && sudo apt install -y php8.2-bz2 php8.2-cgi php8.2-cli php8.2-common php8.2-curl php8.2-dev php8.2-enchant php8.2-fpm php8.2-gd php8.2-gmp php8.2-imap php8.2-intl php8.2-ldap php8.2-mysql php8.2-odbc php8.2-opcache php8.2-pgsql php8.2-phpdbg php8.2-pspell php8.2-readline php8.2-sybase php8.2-tidy php8.2-xmlrpc php8.2-xsl php8.2-sqlite3 php8.2-mbstring php8.2-bcmath php8.2-soap php8.2-zip php8.2-xdebug php8.2-redis php8.2-igbinary php8.2-imagick
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php8.2-
如果要稍后再编译任何附加组件,则必须安装PHP8.3-DEV 。
sudo add-apt-repository -y ppa:ondrej/php
sudo apt install -y php8.3-bz2 php8.3-cgi php8.3-cli php8.3-common php8.3-curl php8.3-dev php8.3-enchant php8.3-fpm php8.3-gd php8.3-gmp php8.3-imap php8.3-intl php8.3-ldap php8.3-mysql php8.3-odbc php8.3-opcache php8.3-pgsql php8.3-phpdbg php8.3-pspell php8.3-readline php8.3-sybase php8.3-tidy php8.3-xmlrpc php8.3-xsl php8.3-sqlite3 php8.3-mbstring php8.3-bcmath php8.3-soap php8.3-zip php8.3-xdebug php8.3-redis php8.3-igbinary php8.3-imagick
如果您收到GPG警告,请使用此解决方法对其进行修复:oerdnj/deb.sury.org#1429(评论)
如果您正在寻找更多的PHP模块,请尝试:
sudo apt-cache search php8.3-
例如,从8.1切换到8.2
Apache:
sudo a2dismod php8.1
sudo a2enmod php8.2
sudo service apache2 restart
确保通过sudo apt install -y libapache2-mod-php8.*
命令行:
sudo update-alternatives --set php /usr/bin/php8.2
sudo update-alternatives --set phar /usr/bin/phar8.2
sudo update-alternatives --set phar.phar /usr/bin/phar.phar8.2
sudo update-alternatives --set php-config /usr/bin/php-config8.2
curl -sS https://getcomposer.org/installer | php && sudo mv composer.phar /usr/local/bin/composer
禁用Xdebug作为作曲家
sudo phpdismod -s cli xdebug
并在.bashrc文件中添加此行:
# Load xdebug Zend extension with php command
alias php='php -dzend_extension=xdebug.so'
# PHPUnit needs xdebug for coverage. In this case, just make an alias with php command prefix.
alias phpunit='php $(which phpunit)'
wget https://phar.phpunit.de/phpunit.phar && chmod +x phpunit.phar && sudo mv phpunit.phar /usr/local/bin/phpunit
对于PHP 5.6
sudo apt install -y apache2 libapache2-mod-php5.6
对于PHP 7.*
sudo apt install -y apache2 libapache2-mod-php7.*
对于PHP 8.*
sudo apt install -y apache2 libapache2-mod-php8.*
启用mod_rewrite
sudo a2enmod rewrite
启用php-mcrypt
对于PHP 5
sudo php5enmod mcrypt && sudo service apache2 restart
对于PHP 7(如果有MCRYPT可用)
sudo phpenmod mcrypt && sudo service apache2 restart
如果您正在寻找更多的Apache模块,请尝试:
sudo apt-cache search libapache2-mod
启用模块vhost_alias
sudo a2enmod vhost_alias
接下来,打开/etc/apache2/apache2.conf
sudo vim /etc/apache2/apache2.conf
并在IncludeOptional sites-enabled/*.conf行之前添加以下行。
UseCanonicalName Off
LogFormat "%V %h %l %u %t "%r" %s %b "%{Referer}i" "%{User-Agent}i"" dynamic_vhosts
CustomLog ${APACHE_LOG_DIR}/access.log dynamic_vhosts
<VirtualHost *:80>
VirtualDocumentRoot /var/www/domains/%-2+/public_html
VirtualScriptAlias /var/www/domains/%-2+/cgi-bin
<Directory /var/www/domains>
DirectoryIndex index.html index.php
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
</VirtualHost>
确保Apache用户可以访问文件夹。 Ubuntu 24在 /Home /用户文件夹中已有750条许可。
如果要禁用所有配置的虚拟主机,请在配置文件中注释此行:
#IncludeOptional sites-enabled/*.conf
这为在端口80以上的任何域(HTTP流量的默认端口,如果您使用HTTPS的默认端口)设置了所有捕获量,则需要使用443-另外,您可以删除端口限制)。这里的重要行是VirtualDocumentRoot。告诉Apache您的文件将位于磁盘上。 %0零件将整个域名插入并将其插入路径。但是我不想在磁盘上的文件夹中包含域的.test部分,否则我们使用%-2+来说明这一点,如果我们去了一个域somesite.com.test the virtualdocumentroot是:
/var/www/html/domains/somesite.com
现在,您必须在本地计算机上添加自动.test域:
编辑file /etc/NetworkManager/NetworkManager.conf ,然后将行dns=dnsmasq添加到[main]部分,看起来像这样:
[main]
plugins=ifupdown,keyfile
dns=dnsmasq
[ifupdown]
managed=false
[device]
wifi.scan-rand-mac-address=no
让NetworkManager管理 /etc/resolv.conf
sudo rm /etc/resolv.conf
sudo ln -s /var/run/NetworkManager/resolv.conf /etc/resolv.conf
Add custom tld:
echo 'address=/.test/127.0.0.1' | sudo tee /etc/NetworkManager/dnsmasq.d/test-tld
Reload NetworkManager:
sudo systemctl reload NetworkManager
Now domain somesite.com.test should work.
First of all Generate SSL certificates for local domains
After you can use this small script, for generating SSL certificate for all virtual domains (folders).
#! /usr/bin/env bash
cmd_array=( mkcert -key-file key.pem -cert-file cert.pem )
for d in /var/www/html/domains/ * / ; do
cmd_array+=( ` basename " $d " ` .test)
done
" ${cmd_array[@]} " And add the generated cert.pem and key.pem to the apache configuration file, edit /etc/apache2.conf
Add new VirtualHost section:
<VirtualHost *:443>
VirtualDocumentRoot /var/www/html/domains/%-2+/public
SSLEngine on
SSLCertificateFile /path/to/generated/certs/cert.pem
SSLCertificateKeyFile /path/to/generated/certs/key.pem
<Directory /var/www/html/domains>
DirectoryIndex index.html index.php
Options Indexes FollowSymLinks MultiViews Includes
AllowOverride All
Order deny,allow
Allow from all
Require all granted
</Directory>
</VirtualHost>
Make sure the mod_ssl is enabled and restart the apache.
Or if you prefer to use nginx
For stable version
sudo add-apt-repository -y ppa:nginx/stable
For latest (recommended)
sudo add-apt-repository -y ppa:nginx/development
And after install
sudo apt install -y nginx
mkcert automatically creates and installs a local CA in the system root store, and generates locally-trusted certificates.
Download mkcert precompiled binary from https://github.com/FiloSottile/mkcert/releases
wget -O mkcert https://github.com/FiloSottile/mkcert/releases/download/v1.4.3/mkcert-v1.4.3-linux-amd64
chmod +x mkcert
Generate and install root certificates:
mkcert -install
Root certificates will be placed under mkcert -CAROOT . For Ubuntu its /home/<user>/.local/share/mkcert
After you can generate certificates for your domains:
mkcert -key-file key.pem -cert-file cert.pem example.test *.example.test example2.test *.example2.test
Now you can add the generated cert.pem and key.pem to your webserver configuration.
If you use Apache Dynamic Virtualhosts, you can generate certs automatically. Read more in Configure SSL for Dynamic Virtualhosts
You can get latest version number on https://dev.mysql.com/downloads/repo/apt
wget https://dev.mysql.com/get/mysql-apt-config_0.8.30-1_all.deb
sudo dpkg -i mysql-apt-config_0.8.30-1_all.deb
sudo apt update & sudo apt install -y mysql-server
For start configuring MySQL server, run:
sudo mysql_secure_installation
If you are not able to login with root user, run:
sudo mysql
and run:
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YourPassword';
If even with sudo mysql not able to log in, try this:
Add --skip-grant-tables option to startup command:
sudo vim /usr/lib/systemd/system/mysql.service
Run FLUSH PRIVILEGES; and after:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'MyNewPass';
Login in MySQL shell and run:
CREATE USER 'root'@'%' IDENTIFIED BY 'secret';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
Also Update mysql server config:
For MySQL 5.*
sudo sed -i 's/bind-address/bind-address = 0.0.0.0#/' /etc/mysql/my.cnf
For MySQL 8.*
echo 'bind-address = *' | sudo tee -a /etc/mysql/mysql.conf.d/mysqld.cnf
Restart the service:
sudo service mysql restart
Check if mysql listens port correctly
sudo netstat -tulnp | grep mysql
Output should be something like:
tcp6 0 0 :::33060 :::* LISTEN 13143/mysqld
tcp6 0 0 :::3306 :::* LISTEN 13143/mysqld
You can also run the nmap command from a remote computer to check whether MySQL port 3306 is open to the remote host.
nmap {server-ip}
Percona Toolkit is a collection of advanced open source command-line tools, developed and used by the Percona technical staff, that are engineered to perform a variety of MySQL® and MongoDB® server and system tasks that are too difficult or complex to perform manually – freeing your DBAs for work that helps you achieve your business goals.
sudo apt install -y percona-toolkit
This is a very nice utility https://github.com/dbcli/mycli
pip install mycli
Usage (See the documents from the git link above for more example):
mycli -h localhost -u root
mycli -h localhost -u root -p
sudo apt install -y postgresql libpq-dev
sudo apt install -y memcached php-memcached
Install redis latest stable version
curl -fsSL https://packages.redis.io/gpg | sudo gpg --dearmor -o /usr/share/keyrings/redis-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
sudo apt-get update
sudo apt-get install redis
Add to startup:
sudo systemctl enable redis-server.service
Disable default instance
sudo systemctl stop redis-server
sudo systemctl disable redis-server
Repeat these steps to configure a Redis instance for every instance you want to set up:
In this case we set up first instance called "redis_1"
Create folders and configs:
sudo mkdir /etc/redis/redis_1
sudo cp /etc/redis/redis.conf /etc/redis/redis_1/redis.conf
sudo chown -R redis:redis /etc/redis
In the config file edit lines:
daemonize no
supervised systemd
pidfile /run/redis/redis_1.pid
logfile /var/log/redis/redis_1.log
dir /var/lib/redis/redis_1/
Define a "port" number.
port 6379
Warning: Remember that each instance should be running on a different port.
Create the database directories at the location given in the configuration file.
sudo mkdir /var/lib/redis/redis_1
sudo chown redis:redis /var/lib/redis/redis_1
sudo chmod 0750 /var/lib/redis/redis_1
Create the service unit file "/etc/systemd/system/[email protected]" with the following contents:
[Unit]
Description=Redis persistent key-value database
After=network.target
[Service]
Type=simple
User=redis
Group=redis
ExecStart=/usr/bin/redis-server /etc/redis/%i/redis.conf
ExecStop=/bin/kill -s TERM $MAINPID
PrivateTmp=true
PIDFile=/var/run/redis/%i.pid
RuntimeDirectory=%i
RuntimeDirectoryMode=2755
LimitNOFILE=65536
Restart=always
TimeoutStopSec=0
UMask=007
PrivateDevices=yes
ProtectHome=yes
ReadOnlyDirectories=/
ReadWriteDirectories=-/var/lib/redis
ReadWriteDirectories=-/var/log/redis
ReadWriteDirectories=-/var/run/redis
NoNewPrivileges=true
CapabilityBoundingSet=CAP_SETGID CAP_SETUID CAP_SYS_RESOURCE
RestrictAddressFamilies=AF_INET AF_INET6 AF_UNIX
MemoryDenyWriteExecute=true
ProtectKernelModules=true
ProtectKernelTunables=true
ProtectControlGroups=true
RestrictRealtime=true
RestrictNamespaces=true
# redis-server can write to its own config file when in cluster mode so we
# permit writing there by default. If you are not using this feature, it is
# recommended that you replace the following lines with "ProtectSystem=full".
ProtectSystem=true
ReadWriteDirectories=-/etc/redis
[Install]
WantedBy=multi-user.target
Start the new redis instance:
sudo systemctl start redis@redis_1
sudo systemctl enable redis@redis_1
Install ELK stack: Elasticsearch, Logstash, and Kibana
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
sudo apt install -y apt-transport-https
echo "deb https://artifacts.elastic.co/packages/7.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-7.x.list
sudo apt update && sudo apt install -y elasticsearch
To configure Elasticsearch to start automatically when the system boots up, run the following commands:
sudo /bin/systemctl daemon-reload
sudo /bin/systemctl enable elasticsearch.service
Install certbot (https://certbot.eff.org)
sudo snap install --classic certbot
Generating for nginx:
sudo snap install certbot-nginx-unit
sudo certbot --nginx
Generating for apache:
sudo certbot --apache
You can test automatic renewal for your certificates by running this command:
sudo certbot renew --dry-run
sudo apt install -y default-jre
sudo apt-add-repository ppa:phalcon/stable
sudo apt update
sudo apt install -y php5-phalcon
This is an easy to use install script that will cleanup after itself. It can also be used for updating:
sudo bash install_phalcon_devtools.sh
To test it run: $ phalcon
We will use the Access Control Lists (ACL) or (Filesystem Access Control List). We will use group permissions for folders so you don't have to make the public writable, because 777 is dangerous.
# Make sure you have ACL installed
sudo apt install -y acl
Look for your main partition with:
$ df
Mine happens to be dev/root , yours may be dev/sda or something. Make sure to replace that below:
# T
sudo /sbin/tune2fs -o +acl /dev/root
To see what file system you are using ext3 , ext4 , etc, use the partition:
sudo file -sL /dev/root
We have to put the partition in read-only mode, then remount it:
sudo /bin/mount -o remount /dev/root
Apply Group
# This sets the Defaults
setfacl -Rd g:www-data:rw /var/www
# This sets future file
setfacl -Rm g:www-data:rw /var/www
To Modify
setfacl -Rm g:www-data:rw /var/www
Otherwise you could always set up a crontab such as:
crontab -e
Then append this to run every five minutes.
*/5 * * * * /home/<user>/backup.sh chgrp -R www-data /var/www && chmod g+rw /var/www
Lastly, you could have a deploy script that does this for you, such as Python Fabfile , but that's another topic.
(Back to top)
- Installation packages: - Python3 - Virtualenv
Python is installed by default on Ubuntu, version 3.12 is suitable. I strongly recommend installing python-dev for headers to compile certain PIP packages.
sudo apt install -y python3-dev python3-full libmysqlclient-dev
sudo pip install fabric virtualenv virtualenvwrapper django
Check the Python version installed, using below command
python3 -V
Virtualenv is a tool to create isolated Python environments. install the virtualenv package
pip install virtualenv
Create an Environment with virtualenv
virtualenv -p python3.5 --no-site-packages env
Activate script
cd env
source bin/activate
停用
deactivate
(Back to top)
Install Golang. You can check latest version of Golang here https://golang.org/dl/#featured While writing this article, lastest version was 1.9
sudo add-apt-repository -y ppa:gophers/archive
sudo apt -y update && sudo apt install golang-1.9
After that your installation will be in the /usr/lib/go-1.9 I recommend create symlink:
sudo ln -s /usr/lib/go-1.9 /usr/local/go
And Add /usr/local/go/bin to the PATH environment variable. You can do this by adding this line to your /etc/profile (for a system-wide installation) or $HOME/.profile :
PATH="$PATH:/usr/local/go/bin"
(Back to top)
Install Ruby 2.X with header files in ruby2.0-dev , this will keep your gems from having issues.
sudo apt install -y ruby2.0 ruby2.0-dev
For Ruby RVM (Version Management)
gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3
curl -sSL https://get.rvm.io | bash -s stable
(Back to top)
I recommend install NodeJS using Node Version Manager
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
To download, compile, and install the latest release of node, do this:
nvm install node # "node" is an alias for the latest version
To install a specific version of node:
nvm install 6.14.4 # or 10.10.0, 8.9.1, etc
To install a latest LTS version of node:
nvm install --lts
You can list available versions using ls-remote:
nvm ls-remote
And then in any new shell just use the installed version:
nvm use [version]
(Back to top)
For installation Yarn package manager run:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install -y yarn
(Back to top)
sudo apt install -y ansible
(Back to top)
Ultimate entertainment platform. http://store.steampowered.com/
sudo apt install -y steam
PCSX-Reloaded - PlayStation 1 Emulator. https://pcsxr.codeplex.com/
Install emulator:
sudo apt install -y pcsxr
pscxr can simulate a bios file. However if you need to use a bios, download and move the file into ~/.pcsx/bios/ .
Download games from http://redump.org/discs/system/psx/ or https://rutracker.org/forum/viewtopic.php?t=4496017 and put under ~/.pcsx/games/
After that run PCSX, configure and play
Open sysctl.conf
sudo vim /etc/sysctl.conf
Add this line:
fs.inotify.max_user_watches = 524288
And after run
sudo sysctl -p
Note: for security reasons, not recommended
sudo git config --global http.sslVerify false
gnome-terminalnautilus -w Setup VIM
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
And copy .vimrc file in your home folder (/home//.vimrc) After run
$ vim
:PluginInstall
Go to System "Settings" > "Keyboard" > "Text Entry" and add Georgian layout. Also enable "Allow different sources for each window"
List input devices tofind the id
xinput --list
You have to find input device, like "SynPS/2 Synaptics TouchPad". In my case id was 12.
To list supported settings for device, run:
xinput list-props {id}
To change scroll speed, you have to update "Synaptics Scrolling Distance" setting.例如
xinput --set-prop {id} 'Synaptics Scrolling Distance' -200 200
To persist this setting you have to put command in the /etc/X11/xinit/xinputrc file.
Sometimes id can be changed between reboots, so, you have to update file with following lines:
idd=$(xinput --list | grep 'SynPS/2 Synaptics TouchPad' | awk '{print $6}'| cut -d'=' -f2)
xinput --set-prop $idd 'Synaptics Scrolling Distance' -200 200
(Back to top)
These are solutions to fix problems I've encountered.
When you try to login to Ubuntu and it relogs you back into the login screen, this is an infinite loop. The only way I was able to fix it despite all the guides was combining a few of these together.
The first step is to login to a terminal.
CTRL + ALT + F1 (Or F3)
Next, Login as your user who must be able to run sudo.
ls -ld ~ should have these permission exactly as: drwxr-xr-xjohn:johnsudo chmod 755 ~ and sudo chown -R john:john ~ls -ld /tmp should have these permission exactly as: drwxrwxrwtroot:root on /tmpsudo chmod a+wt /tmpls -lta | grep .Xa should be owned by your user, for example john johnroot root or anything than your user/group it's wrongsudo chown john:john .Xauthoritycat ~/.xsession-errorssudo ~/.Xauthority ~/.Xauthority.bakdpkg-reconfigure lightdm , then select lightdm in the menusudo service lightdm restartapt-autoremove may accidentally remove xubuntu-desktop , ubuntu-desktop and LightDM reports no errors.ubuntu-desktop will load the Gnome interfacexubuntu-desktop will load a different interface I'm not familiar withsudo apt install ubuntu-desktopsudo apt autoremove gnome-software && sudo apt install gnome-software If your lspci | grep "VGA" output looks like this:
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f95 (rev a1)
Instead of this:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU117M [GeForce GTX 1650 Ti Mobile] [10de:1f95] (rev a1)
Then you're affected by the issue.
This can be caused by your /usr/share/misc/pci.ids* files being outdated and you can fix it by running:
sudo update-pciids
If the list is not updated even after running the command above, that means your PCI device is brand new, and no one has registered your device to the pci-ids repository.
You can submit an issue/contact us through gitter, or you can add it yourself to https://pci-ids.ucw.cz/. Make sure you have the right vendor ID and the device ID by checking lspci -nn and read the guidelines.
On my device screen brightness and keyboard backlit always resets after reboot, so there is a fix.
First, find config files where your brightness and keyboard backlit state is stored. In my case, it was /sys/class/backlight/nvidia_0/brightness and /sys/class/leds/tpacpi::kbd_backlight/brightness
Test your configs:
echo 1 > /sys/class/leds/tpacpi::kbd_backlight/brightness
echo 70 > /sys/class/backlight/nvidia_0/brightness
Settings should be changed. If not, check configuration files path.
Max brightness you can check via cat /sys/class/backlight/nvidia_0/max_brightness and cat /sys/class/leds/tpacpi::kbd_backlight/max_brightness
Create script under /usr/local/bin/
sudo vim /usr/local/bin/setup-brightness.sh
And put the lines below:
#! /bin/bash
echo 0 > /sys/class/leds/tpacpi :: kbd_backlight/brightness
echo 1 > /sys/class/leds/tpacpi :: kbd_backlight/brightness
echo 70 > /sys/class/backlight/nvidia_0/brightnessCreate systemd service file:
sudo vim /etc/systemd/system/setup-brightness.service
And put content below:
[Unit]
After=graphical.target
Description=Set up the screen and keyboard brightness
[Service]
Type=simple
ExecStart=/usr/local/bin/setup-brightness.sh
[Install]
WantedBy=multi-user.target
Set proper permissions:
sudo chmod 744 /usr/local/bin/setup-brightness.sh
sudo chmod 664 /etc/systemd/system/setup-brightness.service
Test your script by running:
sudo /usr/local/bin/setup-brightness.sh
Enable the service unit:
sudo systemctl daemon-reload
sudo systemctl enable setup-brightness.service
The easiest solution is to define the undocumented GRUB_RECORDFAIL_TIMEOUT variable in /etc/default/grub .例如:
sudo vim /etc/default/grub
and add variable:
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
Also set GRUB_TIMEOUT to 0 . After run:
sudo update-grub
例子:
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=0
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
In Ubuntu 24.04 where certain applications such as Firefox use the top bar as the title bar, whenever you accidentally touch the top bar and drag, it resizes the window, which can be quite frustrating.
To disable this behaviour, you have to disable "Enhanced Tailing" under Settings -> Ubuntu Desktop .
Beware that turning that feature off will also disable Super + Up and Super + Down to maximize and minimize windows.
I prefer dock like Mac. To do this, run commands:
gsettings set org.gnome.shell.extensions.dash-to-dock extend-height false
gsettings set org.gnome.shell.extensions.dash-to-dock dock-position BOTTOM
gsettings set org.gnome.shell.extensions.dash-to-dock transparency-mode FIXED
gsettings set org.gnome.shell.extensions.dash-to-dock dash-max-icon-size 48
gsettings set org.gnome.shell.extensions.dash-to-dock unity-backlit-items false
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
You can resize windows very nicely:
Run this simple command in the terminal and you will see the positions change right away.
Move to right (terminal)
gsettings set org.gnome.desktop.wm.preferences button-layout ':minimize,maximize,close'
Move to left (terminal)
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:'
In terminal make sure this is false, then try your hotkey ctrl+alt+l or if you set it like super+l in the settings:
gsettings set org.gnome.desktop.lockdown disable-lock-screen 'false'
You can toggle these items at https://extensions.gnome.org I suggest creating an account so you have a record.
This is a rare things, it happens much more in Gnome and requires a lot more "damaging" things. To fix a gnome that seems frozen do the following:
ALT + F2 enter in r (lowecase) and press Enter
Create a AppName.desktop file in ~/.local/share/applications with content:
[Desktop Entry]
Version=0.1.1
Type=Application
Name=appName
Comment=Application Description
TryExec=Path/to/AppImage
Exec=Path/to/AppImage
Icon=Path/to/AppImage.icon
Actions=Editor
(Back to top)
This has to do with VirtualBox
Append the following to yourbox.vmx with the machine off.
mouse.vusb.enable = "TRUE"
mouse.vusb.useBasicMouse = "FALSE"
usb.generic.allowHID = "TRUE"
vagrant plugin install vagrant-vbguest
vagrant ssh
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
Running Windows 8 in Virtualbox has an odd error, run this in cmd or powershell , or terminal on linux.
vboxmanage list vms
vboxmanage setextradata "The Box Name" VBoxInternal/CPUM/CMPXCHG16B 1
(Back to top)
I am using Dropbox for syncing configurations
Install Package Control https://packagecontrol.io/installation#st3
后:
cd ~/.config/sublime-text/Packages/
rm -rf User
ln -s ~/Dropbox/workspace/appdata/sublime-text/Packages/User
cd ~/.config/filezilla
rm -f sitemanager.xml
ln -s ~/Dropbox/workspace/appdata/filezilla/sitemanager.xml
(Back to top)
(Back to top)
Remove not neccessary apps from startup
Show system apps in Startup Applications
sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop
Open "Startup Applications" and uncheck apps: Chat, Orca Screen Reader, Zeitgest Datahub
Hide system apps
sudo sed -i 's/NoDisplay=false/NoDisplay=true/g' /etc/xdg/autostart/*.desktop
Remove any unwanted applications.
(Back to top)
By Avtandil Kikabidze aka LONGMAN