–>修改更新源
修改parrot.list
sudo vi /etc/apt/source.list.d/parrot.list
(或者可以修改source.list,把parrot.list的源屏蔽掉)
# parrot repository
# this file was automatically generated by parrot-mirror-selector
# 官方源
#deb http://mirrordirector.archive.parrotsec.org/parrot/ parrot main contrib non-free
#deb-src http://mirrordirector.archive.parrotsec.org/parrot/ parrot main contrib non-free
# 中科大源
deb http://mirrors.ustc.edu.cn/parrot/ parrot main contrib non-free
#deb-src http://mirrors.ustc.edu.cn/parrot/ parrot main contrib non-free
# 清华源
#deb http://mirrors.tuna.tsinghua.edu.cn/parrot/ parrot main contrib non-free
#deb-src http://mirrors.tuna.tsinghua.edu.cn/parrot/ parrot main contrib non-free
–>更新
更新源
sudo apt update --fix-missing
更新软件,及更新操作系统
sudo apt upgrade --fix-missing && sudo apt dist-upgrade --fix-missing
更新完清理一下
sudo apt clean && sudo apt autoclean && sudo apt autoremove -y
清理系统残存配置(使用一次)
sudo dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
清理系统软件包和内核
uname –r 查看正在使用的内核
dpkg --get-selections | grep linux
删除不用的内核文件image、头文件headers
sudo apt purge 内核文件名 头文件名
sudo apt purge linux-image-x.xx.x-xxxxx-amd64 linux-headers-x.xx.x-xxxxx-amd64 linux-headers-x.xx.x-xxxxx-common
删除已下载的缓存
sudo rm -rf /var/lib/apt/lists/
更新脚本
sudo vi /usr/bin/parrot-upgrade
#!/bin/bash
Green_font_prefix="\033[41;37m"
Font_color_suffix="\033[0m"
Info="${Green_font_prefix}[Info]${Font_color_suffix}"
if ping www.baidu.com -c1 >/dev/null 2>&1
then
echo "update list && install httping"
(sudo apt --fix-missing update;sudo apt install httping)
if httping -c1 -g http://www.google.com >/dev/null 2>&1
then
sleep 1
# echo -e "## stable repository\ndeb http://deb.parrotsec.org/parrot stable main contrib non-free" >> /etc/apt/sources.list.d/parrot.list
echo -e "${Info} Write stable repository to parrot.list"
echo "## stable repository" > /etc/apt/sources.list.d/parrot.list
echo "deb http://deb.parrotsec.org/parrot stable main contrib non-free" >> /etc/apt/sources.list.d/parrot.list
echo "#deb-src http://archive.parrotsec.org/parrot stable main contrib non-free" >> /etc/apt/sources.list.d/parrot.list
else
echo -e "${Info} Can't httping test"
echo "## ustc" > /etc/apt/sources.list.d/parrot.list
echo "deb http://mirrors.ustc.edu.cn/parrot/ parrot main contrib non-free" >> /etc/apt/sources.list.d/parrot.list
else
echo "Error: No internet!"
exit 1
fi
echo -e "${Info} --------------<Update && Upgrade parrot>--------------"
set -e
DEBIAN_FRONTEND=noninteractive
apt update || echo failed to update index lists
dpkg --configure -a || echo failed to fix interrupted upgrades
apt --fix-broken --fix-missing install || echo failed to fix conflicts
apt -y --allow-downgrades --fix-broken --fix-missing dist-upgrade
apt autoclean clean
apt autoremove -y
# rm -rf /var/lib/apt/lists/*
# dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P
echo -e "${Info} --------------<Clean parrot done>--------------"
sudo parrot-upgrade
sudo proxychains parrot-upgrade
–>配置sudoers
sudo su
chmod u+w /etc/sudoers
vi /etc/sudoers
# 把用户添加到sudo组
user_name ALL=(ALL:ALL) ALL
chmod u-w /etc/sudoers
–>安装open-vm-tools-desktop
# Parrot默认安装open-vm-tools*
sudo apt install open-vm-tools-desktop fuse -y
–>安装Vim
sudo apt install vim -y
–>SSH
➊允许密码登录 和 root登录
sudo vi /etc/ssh/sshd_config
取消#PasswordAuthentication yes的注释
将#PermitRootLogin prohibit-password,修改为PermitRootLogin yes
➋密钥登录
修改配置文件,启用密钥登陆
sudo vi /etc/ssh/sshd_config
PermitRootLogin no
RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
PasswordAuthentication no # 取消密码认证
用Xshell或者ssh-keygen生成一个密钥
ssh-keygen -t rsa
把.pub公钥内容写入authorized_keys文件里面
cat ~/.ssh/xxx.pub | xargs echo >> ~/.ssh/authorized_keys
开启SSH服务
sudo /etc/init.d/ssh start
开机自动启动SSH服务
sudo update-rc.d ssh enable
SSH相关操作
麻烦的操作
每次链接都太鸡儿麻烦了
# 工作机 --> 跳转机 --> 任意云服务器
ssh jump_user@jump_host --> ssh dev_user@dev_host
极简式操作
首先在跳转机生成ssh私钥和公钥
ssh-keygen -t rsa -C "邮箱"
id_rsa
id_rsa.pub
然后把id_rsa.pub公钥的内容,写入到任意云服务器的~/.ssh/authorized_keys里面
之后在工作机生成ssh私钥和公钥
ssh-keygen -t rsa -C "邮箱"
Work
Work.pub
把Work.pub公钥的内容,写入到跳转机的~/.ssh/authorized_keys里面
之后在跳转机的~/.ssh/下新建一个config文件
config
Host prd
HostName xx.xx.xx.xx
Port 212
User prd_user
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
Host dev
HostName xx.xx.xx.xx
Port 221
User dev_user
IdentityFile ~/.ssh/id_rsa
IdentitiesOnly yes
这样你就可以更方便的连接服务器了
# 连接dev服务器
ssh dev
# 连接prd服务器
ssh prd
之后工作机的~/.ssh/下新建一个config文件,并把跳转机的~/.ssh/id_rsa私钥,复制到~/.ssh/文件夹下,命名为server_key
config
Host jump
HostName xx.xx.xx.xx
Port 122
User jump_user
IdentityFile ~/.ssh/Work
IdentitiesOnly yes
Host prd
HostName xx.xx.xx.xx
Port 212
User prd_user
IdentityFile ~/.ssh/server_key
IdentitiesOnly yes
Host dev
HostName xx.xx.xx.xx
Port 221
User dev_user
IdentityFile ~/.ssh/server_key
IdentitiesOnly yes
这样你就可以更方便的连接服务器了
# 连接跳转机
ssh jump
# 连接dev服务器
ssh jump --> ssh dev
# 连接prd服务器
ssh jump --> ssh prd
不想先连接跳转机再连接云服务器,而是直接通过中间主机建立SSH连接
ssh -t jump ssh dev
通过SSH连接名为test的screen
ssh -t jump screen –R test
通过SSH连接名为test的tmux
ssh -t code tmux a -t test
ssh -t code ssh dev tmux a -t test
相关错误
权限太开放
chmod 600 私钥文件
修改SSH提示信息
修改配置文件
sudo vim /etc/motd
ASCII在线生成
–>配置编译环境,配置gcc
sudo apt install libxml2 python-dev python-pip libxml2-dev libxslt1-dev zlib1g-dev libffi-dev libssl-dev tcl -y
sudo apt install gcc libpcre3 libpcre3-dev zlib1g zlib1g-dev openssl -y
–>配置数据库
->配置MariaDB(MySQL)
->安装MySQL
关闭MySQL服务
sudo service mysql stop
启动mysql不使用密码和权限检查
mysqld_safe --skip-grant-tables &
按回车继续
连接MySQL
sudo mysql -u root mysql
更新密码
UPDATE user SET password=PASSWORD('新密码') WHERE user='root';`
FLUSH PRIVILEGES;
\q
重启mysql服务
sudo service mysql restart
->安装MariaDB
sudo apt install mariadb-server -y
开启SQL服务
sudo service mysql start
初始化安全脚本设置Mariadb密码
sudo mysql_secure_installation
- Enter current password for root #直接回车(默认root是没有密码的)
- Set root password? [Y/n] Y
- New password: #设置新密码
- Re-enter new password: #重复密码
- Remove anonymous users? [Y/n] Y
- Disallow root login remotely? [Y/n] Y
- Remove test database and access to it? [Y/n] Y
- Reload privilege tables now? [Y/n] Y
修改非sudo可以登录数据库
sudo mysql -uroot -p
MariaDB [(none)]> use mysql;
MariaDB [(none)]> update user set plugin='' where User='root';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> \q
允许任意主机登录
mysql -uroot -p
grant all privileges on *.* to 'root'@'%' identified by '你的root密码' with grant option;
flush privileges;
修改配置文件,屏蔽绑定本地ip
sudo vi /etc/mysql/mariadb.conf.d/50-server.cnf
# bind-address = 127.0.0.1
(MariaDB)修改数据库密码
sudo mysql -uroot -p
use mysql;
update mysql.user set password=PASSWORD('新密码') where user='root';
flush privileges;
(MySQL_5.7.19)修改数据库密码
set password for 用户名@localhost = password('新密码');
flush privileges;
重启mysql服务
sudo service mysql restart
或者
sudo /etc/init.d/mysql restart
允许外部链接数据库,查看端口占用情况
netstat -ntlp | grep -v tcp6
ps -aux | grep mysqld
杀掉进程id
sudo kill -9 id
重启SQL服务
->配置Redis
->apt安装
sudo apt install redis-server -y
配置密码并允许外网访问
sudo vi /etc/redis/redis.conf
requirepass 你的密码
bind 0.0.0.0 ::1
->源码安装
官方下载稳定版并解压包
wget http://download.redis.io/releases/redis-x.x.x.tar.gz && tar -zxvf redis-x.x.x.tar.gz
复制并放到usr/local目录下
sudo mv redis-x.x.x/ /usr/local/redis/
进入redis目录
cd /usr/local/redis/
生成&测试&安装
sudo make && sudo make test && sudo make install
修改配置文件
vi ./redis.conf
# 允许外网访问
bing 0.0.0.0
# 守护进程设置为yes
daemonize yes
# 数据文件
dbfilename dump.rdb
# 数据文件存储路径
dir /var/lib/redis
# 日志文件
logfile /var/log/redis/redis-server.log
# 设置密码
requirepass 你的密码
把配置文件移动到/etc/目录下
sudo cp ./redis.conf /etc/redis/
密码访问redis
redis-cli -a 你的密码
->配置MongoDB
->apt安装
sudo apt install mongodb -y
配置密码访问
sudo su
mongo
使用admin库,创建root用户
> use admin
> db.createUser({user: "root", pwd: "123456", roles:["root"]})
启用认证开启mongo服务
service mongodb stop
mongod --auth --port 27017 --dbpath /var/lib/mongodb --bind_ip 0.0.0.0
启用root认证登陆mongo
mongo 127.0.0.1:27017 -u "root" -p "123456" --authenticationDatabase "admin"
创建专属用户
> use 数据库
> db.createUser({user: "cd2", pwd: "cd2", roles:["dbOwner"]})
简单mongo客户端认证
mongo
use 数据库
db.auth({"user":"cd2", "pwd":"cd2"})
show collections
->源码安装
官方下载对应的包环境,解压压缩包
wget xxx.tar.gz && tar -zxvf xxx.tar.gz
移动到/usr/local/目录下
mv -r mongodb-linux-x86_64xxx/ /usr/local/share/mongodb
创建数据库文件夹
sudo mkdir -p /data/db
添加用户环境变量
vi ~/.bashrc
export PATH=/usr/local/share/mongodb/bin:$PATH
软链接可执行
sudo ln -s /usr/local/share/mongodb/bin/mongod /usr/local/bin/mongodb
sudo ln -s /usr/local/share/mongodb/bin/mongod /usr/bin/mongodb
sudo ln -s /usr/local/share/mongodb/bin/mongo /usr/local/bin/mongo
sudo ln -s /usr/local/share/mongodb/bin/mongo /usr/bin/mongo
启动mongodb服务
mongodb
后台启动mongodb服务
sudo /usr/local/share/mongodb/bin/mongod &
或者
sudo nohup /usr/local/share/mongodb/bin/mongod > /home/haha/logs/log.log 2>&1 &
启动mongo
mongo
解决Unable to create/open lock file: /data/db/mongod.lock errno:13 Permission denied
sudo chmod 0755 /data/db
sudo chown `id -u` /data/db
参考地址
查看mongod后台进程
ps -aux | grep mongod | grep -v grep | awk {'print $2'}
->配置Postgresql
使用postgres用户打开psql
sudo -u postgres psql
修改postgres用户(或数据库中其他用户)的密码
\password postgres
或者
\password myuser
退出pgsql
\q
–>配置Nginx
->安装Parrot的Nginx
sudo apt install nginx -y
->安装最新的Nginx
sudo sh -c 'echo "deb http://nginx.org/packages/mainline/debian/ stretch nginx\ndeb-src http://nginx.org/packages/mainline/debian/ stretch nginx" >> /etc/apt/sources.list.d/nginx.list'
wget -qO - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - && sudo apt update &&
sudo apt remove nginx-common --purge -y
sudo apt install nginx -y
->源码安装
在nginx官网下载并安装稳定版nginx
解包
tar -zxvf nginx… … && cd nginx… …
编译
./config… …
安装
sudo make && sudo make install
->nginx相关
重新加载配置文件
./nginx -s reload
重启nginx
./nginx -s stop
查看端口占用情况
netstat -ntpl
log错误,权限问题
–>安装虚拟环境
pip源
-
本地持久化
更换清华pip源
mkdir ~/.pip && cd ~/.pip && vi pip.conf
[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple
-
临时变量
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple 包名
安装virtualenv虚拟环境及pep8
sudo apt install python-virtualenv -y
sudo pip install virtualenv virtualenvwrapper pep8 autopep8 pylint
-
创建目录存放虚拟环境
mkdir $HOME/.virtualenvs
-
在用户环境变量~/.bashrc中添加:
vi ~/.bashrc
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
-
应用环境变量
source ~/.bashrc
-
Error:/usr/bin/python: No module named virtualenvwrapper
~/.bashrc加入
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
-
创建并进入虚拟环境(Python2)
mkvirtualenv 虚拟环境名
-
进入虚拟环境
workon xxx
创建独立Py2虚拟环境
相当于一个程序一个Py2的环境包
virtualenv venv-py27
进入环境
source ./venv-py27/bin/activate
pip包导出,升级
-
导出
pip freeze > xxx.txt
-
导出关键包
pip show 包名
# "Requires: "是它的依赖包,导出包时,去掉它的依赖包
-
导入pip包
pip install -r xxx.txt
-
列出可升级的包
pip list --outdate
-
升级所有可升级的包
pip freeze --local | grep -v '^\-e' | cut -d = -f 1 | xargs pip install -U
安装pip3
sudo apt install python3-pip -y
sudo pip3 install virtualenv virtualenvwrapper
创建并进入虚拟环境(Python3)
mkvirtualenv -p /usr/bin/python3.6 Py3
创建独立Py3虚拟环境
virtualenv -p /usr/bin/python3.6 venv-py36
进入环境
source ./venv-py36/bin/activate
–>配置开发软件
安装tree,htop,hexedit,screen,ipython3,谷歌拼音输入法
sudo apt install tree htop hexedit screen ipython3 fcitx fcitx-googlepinyin
->VimPlus
VimPlus
git clone https://github.com/chxuan/vimplus.git ~/.vimplus && cd ~/.vimplus
# 安装vimplus
sudo ./install.sh
# 有时候ycm无法安装,所以先root试水
./install.sh
查找某些字符串
find ~/.vim/ -name \* -type f -print | xargs grep "# coding=utf-8"
修改Py2的注释
~/.vim/plugged/prepare-code/snippet/snippet.py
更换颜色主题
vi ~/.vimrc
" 主题
colorscheme peachpuff
问题解决:编译ycm提示要vim支持python/python3
# 查看vim支持情况
vim --version
# 如果不支持python/pyhton3,删除vim以及所有依赖
dpkg -l | grep vim
sudo apt remove vim vim-common vim-runtime vim-xxx --purge -y
# 安装依赖
sudo apt install libncurses5-dev python3-dev -y
# 下载git最新的vim源码,然后编译
git clone https://github.com/vim/vim.git && cd vim
sudo ./configure --with-features=huge \
--enable-multibyte \
--enable-rubyinterp=yes \
--enable-pythoninterp=yes \
--with-python-config-dir=/usr/lib/python2.7/config-x86_64-linux-gnu \
--enable-python3interp=yes \
--with-python3-config-dir=/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu \
--enable-perlinterp=yes \
--enable-luainterp=yes \
--enable-gui=gtk2 --enable-cscope --prefix=/usr
sudo make VIMRUNTIMEDIR=/usr/share/vim/vim81
# 安装 vim
sudo make install
vim --version
# 之后再安装vimplus
/usr/bin/vim替换/usr/bin/vi
->SpaceVim
SpaceVim
安装方法
->PyCharm
下载解压之后,移到/opt/文件夹,在applications创建图标
sudo leafpad /usr/share/applications/Pycharm.desktop
[Desktop Entry]
Type=Application
Name=Pycharm
GenericName=Pycharm3
Comment=Pycharm3:The Python IDE
Exec="/opt/pycharm-201x.x.x/bin/pycharm.sh" %f
Icon=/opt/pycharm-201x.x.x/bin/pycharm.png
Terminal=pycharm
Categories=Pycharm;
激活
屏蔽检测激活
sudo vi /etc/hosts
hosts文件添加:
0.0.0.0 account.jetbrains.com
K71U8DBPNE-eyJsaWNlbnNlSWQiOiJLNzFVOERCUE5FIiwibGljZW5zZWVOYW1lIjoibGFuIHl1IiwiYXNzaWduZWVOYW1lIjoiIiwiYXNzaWduZWVFbWFpbCI6IiIsImxpY2Vuc2VSZXN0cmljdGlvbiI6IkZvciBlZHVjYXRpb25hbCB1c2Ugb25seSIsImNoZWNrQ29uY3VycmVudFVzZSI6ZmFsc2UsInByb2R1Y3RzIjpbeyJjb2RlIjoiSUkiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJSUzAiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJXUyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IlJEIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUkMiLCJwYWlkVXBUbyI6IjIwMTktMDUtMDQifSx7ImNvZGUiOiJEQyIsInBhaWRVcFRvIjoiMjAxOS0wNS0wNCJ9LHsiY29kZSI6IkRCIiwicGFpZFVwVG8iOiIyMDE5LTA1LTA0In0seyJjb2RlIjoiUk0iLCJwYWlkVXBUbyI6IjI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Uqr8h7Z2gsx5LcIf5kYNsqJ0GavXTVyWh7PYiKX4bs354ZQLUwwa/cG++2+wNWP+HtBhVxMRNTdVhSm38AknZlD+PTAsWGu9GyLmhti2EnVwGybSD2Dxmhxk3IPCkhKAK+pl0eWYGZWG3tJ9mZ7SowcXLWDFAk0lRJnKGFMTggrWjV8GYpw5bq23VmIqqDLgkNzuoog==
配置
- Pycharm添加PEP8代码规范
打开Pycharm→File→settings→Tools→External Tools→添加
Name:PEP8(名字随便)
Tools settings里面添加
Programs:autopep8 # 你需要用pip安装autopep8
Parameters:--in-place --aggressive --aggressive $FilePath$
Working directory:$ProjectFileDir$
Output filters:$FILE_PATH$\:$LINE$\:$COLUMN$\:.*
- Pycharm配置Pylint(不在虚拟环境)
Name:Pylint(名字随便)
Tools settings里面添加
Programs:pylint # 你需要用pip安装pylint
Arguments:--reports=n --disable=C0103 $FilePath$
Working directory:$FileDir$
Output filters:$FILE_PATH$:$LINE$:
- Pycharm配置Pylint(多个虚拟环境下)
Name:Pylint(名字随便)
Tools settings里面添加
Programs:$PyInterpreterDirectory$/pylint # 你需要用pip安装pylint
# $PyInterpreterDirectory$/pylint后面有一个空格
Arguments:$FileRelativePath$
Working directory:$FileDir$
Output filters:$FILE_PATH$:$LINE$:
- Pycharm_2017.1.4版本
点击Output Files→添加
如需终端启动Pycharm,写入环境变量
vi .bashrc
alias pycharm="'/opt/pycharm-2018.x.x/bin/pycharm.sh' %f"
source ~/.bashrc
插件
VueJs
File -> Settings -> Plugins -> Install JetBrains plugin... -> Vue.js
Bash
File -> Settings -> Plugins -> Install JetBrains plugin... -> BashSupport
->Sublime
-
安装GPG密钥
wget -qO - https://download.sublimetext.com/sublimehq-pub.gpg | sudo apt-key add -
-
确保apt已设置为使用https资源
sudo apt install apt-transport-https -y
-
选择稳定版
echo "deb https://download.sublimetext.com/ apt/stable/" | sudo tee /etc/apt/sources.list.d/sublime-text.list
-
更新apt源并安装Sublime Text
sudo apt update --fix-missing && sudo apt install sublime-text
-
之后修改/etc/hosts,添加以下网址
# Sublime
127.0.0.1 license.sublimehq.com
127.0.0.1 45.55.255.55
127.0.0.1 45.55.41.223
----- BEGIN LICENSE -----
sgbteam
Single User License
EA7E-1153259
8891CBB9 F1513E4F 1A3405C1 A865D53F
115F202E 7B91AB2D 0D2A40ED 352B269B
76E84F0B CD69BFC7 59F2DFEF E267328F
215652A3 E88F9D8F 4C38E3BA 5B2DAAE4
969624E7 DC9CD4D5 717FB40C 1B9738CF
20B3C4F1 E917B5B3 87C38D9C ACCE7DD8
5F7EF854 86B9743C FADC04AA FB0DA5C0
F913BE58 42FEA319 F954EFDD AE881E0B
------ END LICENSE ------
-
取消更新检测(需要先注册Key)
首选项–>设置
"update_check": false
-
无法输入中文解决办法
新建一个sublime_imfix.c,并写入以下代码
vi sublime_imfix.c
#include <gtk/gtkimcontext.h>
void gtk_im_context_set_client_window (GtkIMContext *context,
GdkWindow *window)
{
GtkIMContextClass *klass;
g_return_if_fail (GTK_IS_IM_CONTEXT (context));
klass = GTK_IM_CONTEXT_GET_CLASS (context);
if (klass->set_client_window)
klass->set_client_window (context, window);
g_object_set_data(G_OBJECT(context),"window",window);
if(!GDK_IS_WINDOW (window))
return;
int width = gdk_window_get_width(window);
int height = gdk_window_get_height(window);
if(width != 0 && height !=0)
gtk_im_context_focus_in(context);
}
安装C/C++的编译环境和gtk libgtk2.0-dev
sudo apt install build-essential libgtk2.0-dev -y
把sublime_imfix.c编译成libsublime-imfix.so
gcc -shared -o libsublime-imfix.so sublime_imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC
然后将libsublime-imfix.so拷贝到sublime_text所在文件夹
sudo mv libsublime-imfix.so /opt/sublime_text/
修改文件/usr/bin/subl的内容
sudo vi /usr/bin/subl
将:
exec /opt/sublime_text/sublime_text "$@"
修改为:
LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text "$@"
执行subl命令可以在sublime中输入中文
使用鼠标右键打开文件,以及双击,点击图标可以输入中文,还需要修改文件sublime_text.desktop的内容
sudo vi /usr/share/applications/sublime_text.desktop
将[Desktop Entry]中的字符串
Exec=/opt/sublime_text/sublime_text %F
修改为
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text %F"
将[Desktop Action Window]中的字符串
Exec=/opt/sublime_text/sublime_text -n
修改为
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text -n"
将[Desktop Action Document]中的字符串
Exec=/opt/sublime_text/sublime_text --command new_file
修改为
Exec=bash -c "LD_PRELOAD=/opt/sublime_text/libsublime-imfix.so exec /opt/sublime_text/sublime_text --command new_file"
->安装谷歌浏览器
安装谷歌浏览器
sudo dpkg -i google... ...
未满足依赖解决
sudo apt --fix-broken install
# root下谷歌浏览器权限开启
- -no-sandbox - -user-data-dir &
解决虚拟机卡顿,Linux假死
高级设置 --> 取消硬件加速模式
chrome://flags/#smooth-scrolling --> Disabled
->配置火狐浏览器中文包
浏览器添加中文包
https://addons.mozilla.org/en-US/firefox/addon/chinese-simplified-zh-cn-la/
打开配置
about:config
右键,New,String
intl.locale.requested
zh_CN
重启浏览器
->安装搜狗拼音
选择任意存储位置,下载deb包
wget http://cdn2.ime.sogou.com/dl/index/1524572264/sogoupinyin_2.2.0.0108_amd64.deb?st=6d_NQp51zU3RGqNgAQ5_MQ&e=1527664818&fn=sogoupinyin_2.2.0.0108_amd64.deb
之后在deb包上,右键,用GDebi软件包安装程序打开,然后install…
提示需要依赖解决
sudo apt install -f
->Lua以及Parrot-Conky的安装
Lua以及Parrot-Conky的安装
如果要显示/home的使用量,系统发行版本,mate版本
sudo conky
–>bash隐藏用户名和主机名
修改用户环境变量bashrc
vi ~/.bashrc
export PS1='\[\033[01;31m\] ❥❥❥ \[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
应用环境变量
–>安装中文字体
通用方法,只给当前用户安装
在当前用户主目录下创建文件夹.fonts,把字体文件移动到里面
mkdir ~/.fonts
然后刷新字体信息文件
fc-cache -f -v
Debian的快捷方法
安装Microsoft核心字体集
sudo apt install ttf-mscorefonts-installer
之后再把一些中文字体移动到/usr/share/fonts/truetype/目录下
sudo mv xxx /usr/share/fonts/truetype/
–>开机启动
添加程序开机启动
sudo update-rc.d sshd enable
移除程序开机启动
sudo update-rc.d -f sshd remove
–>配置Chromedriver
官网
下载解压Chromedriver
wget -N https://chromedriver.storage.googleapis.com/2.41/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
添加执行权限
chmod +x chromedriver
添加软链接
sudo mv -f chromedriver /usr/local/share/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/local/bin/chromedriver
sudo ln -s /usr/local/share/chromedriver /usr/bin/chromedriver
–>安装BurpSuite Pro 2.0.03beta
在BurpSuite官网,下载Community版本的sh文件;
安装"sudo bash burpsuite_community_linux_v1_7_36.sh"
把破解的2.0.3beta pro版的jar包,改名为burpsuite_community.jar,并替换软件安装目录下的burpsuite_community.jar,把破解补丁也移动到burpsuite安装目录
修改BurpSuiteCommunity.vmoptions文件为以下内容:
-Xmx2048m
-Xbootclasspath/p:burp-loader-keygen.jar
启动burp-loader-keygen.jar,"sudo java -jar burp-loader-keygen.jar",点击run
去/usr/share/applications/下找到BurpSuiteCommunity的快捷方式并启动
取消协助,同意协议
随意修改burp-loader-keygen的License Text
把License复制到BurpSuite
点击Manual activation,点击Copy request
把Request复制到burp-loader-keygen的Activation Request
把自动生成的Activation Response复制回BurpSuite
–>配置静态IP
修改虚拟机,编辑——virtual网络设置的VMnet8,勾掉使用本地DHCP服务… …
再点NAT设置,查看网关ip是多少,192.168.75.2
修改网络配置里面,VMware VMnet8的ipv4配置
ip:192.168.75.1
默认:255.255.255.0
默认网关:192.168.75.2
修改配置文件
/etc/network/interfaces
添加
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.75.142
netmask 255.255.255.0
gateway 192.168.75.2
修改默认网关
/etc/resolv.conf
添加
nameserver 192.168.75.2
reboot
Java环境变量(Linux)
因ParrotSec的java是openjdk,所以去官网下载jdk8
修改/etc/profile和~/.bashrc
export JAVA_HOME=/opt/jdk1.8.0_151
export JRE_HOME=$JAVA_HOME/jre
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/lib
–>问题解决
->venv安装MySQL-python
Command “python setup.py egg_info” failed
-
安装依赖libmysqlclient18
Debian官方
sudo apt install libmysqlclient18
-
安装依赖libmysqlclient-dev
Debian官方
sudo apt install libmysqlclient-dev
sudo apt --fix-broken install
-
安装MySQL-python
pip install MySQL-python
->改变系统语言
中文改英文
sudo vi /etc/default/locale
# 将zh_cn
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
# 改为
LANG="en_US.UTF-8"
LANGUAGE="en_US:en"
之后选中en-US.UTF-8 UTF-8
dpkg-reconfigure locales
->无法联网
更新所有软件,并更新系统之后,安装完所有环境,重启后,Parrot无法联网,可以ping通ip地址,但是无法ping通域名,dns解析出现问题
删掉原dns文件连接
rm -rf /etc/resolv.conf
新建并打开dns文件,添加下面内容
vi /etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4
重启网络
sudo service networking restart
->Proxychains的问题
解决’libproxychains.so.3’ from LD_PRELOAD cannot be preloaded
无法加载libproxychains.so.3库
正确文件位置
/usr/lib/x86_64-linux-gnu/libproxychains.so.3
修改配置文件
vi /usr/bin/proxychains
把
export LD_PRELOAD=libproxychains.so.3
改为
export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libproxychains.so.3
->无法安装ipy2
在python2的虚拟环境下安装ipython2,报错,提示Command "python setup.py egg_info"
提示信息,ipython6不支持python2,所以指定安装版本pip install ipython==5.5.0
->Py2无法安装Pylint
提示支持版本>=3.4
pip install pylint==1.9.3
->无法安装Tor的问题
点击菜单栏的Tor browaser安装提示签名验证失败
gpg --homedir "$HOME/.local/share/torbrowser/gnupg_homedir/" --refresh-keys --keyserver pool.sks-keyservers.net
sudo lsof -i:9040
sudo netstat -tunlp | grep 9040
–>右上角parrot menu不显示应用程序项目
rm -rf ~/.config/menus
–>控制中心丢失"网络连接",“caja-actions-configuration-tool”
修复"网络连接"
sudo apt install network-manager-gnome -y
修复"caja-actions-configuration-tool"
sudo apt install caja-actions -y