1.MySQL不能被正常安装导致apt使用异常
卸载MySQL重新安装会出现如下问题:
出现该问题主要是安装MySQL前需要删除 /var/lib/mysql文件夹以及/etc/mysql文件夹
执行命令:
sudo rm /var/lib/mysql -R sudo rm /etc/mysql -R sudo apt-get autoremove mysql* --purge sudo apt-get remove apparmor
2.删除远程分支
$ git push origin --delete demo
3.centos内核升级
参考:https://blog.janfou.com/technical-documents/11220.html
4.需要上传包到远程服务器(脚本)
# coding:utf-8 import os import paramiko import sys # src_path = sys.argv[1] # dest_path = sys.argv[2] src_path = sys.argv[1] dest_path = ".../UCBrowser.apk" dest_path2 = ".../UCBrowser.apk" # dest_path = "/tmp/UCBrowser.apk" def connect(): ssh = paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) try: ssh.connect('***', username='***', password='***', port=19922, allow_agent=True) return ssh except: return None def _command(args, outpath): cmd = '%s %s' % (outpath, args) return cmd def exec_commands(conn, cmd): stdin, stdout, stderr = conn.exec_command(cmd) results = stdout.read() return results def copy_moddule(conn, src_path, dest_path): ftp = conn.open_sftp() ftp.put(src_path, dest_path) ftp.close() return dest_path def excutor(): conn = connect() if not os.path.isfile(src_path): print src_path + " not exist !!!, please check again." sys.exit(1) if not conn: return [None] # file copy copy_moddule(conn, src_path, dest_path) copy_moddule(conn, src_path, dest_path2) print "copy file succ!!!" # adb install apk result = exec_commands(conn, "adb install -r " + dest_path) print result if __name__ == '__main__': excutor()
3.docker启动开启2375端口
ubuntu:
sudo vim /etc/default/docker
DOCKER_OPTS="-H=unix:///var/run/docker.sock -H=0.0.0.0:2375"
Centos:
sudo vim /etc/sysconfig/docker
other_args='-Htcp://0.0.0.0:2375 -H unix:///var/run/docker.sock' #centos6下使用
OPTIONS='-Htcp://0.0.0.0:2375 -H unix:///var/run/docker.sock' #centos7下使用
4.Mysql远程连接设置
mysql> use mysql; Database changed mysql> grant all privileges on *.* to root@'%' identified by "root"; Query OK, 0 rows affected (0.00 sec)
5.ubuntu磁盘清理
大文件过滤
find / -size +100M |xargs ls -lh
6.Idea创建maven项目,生成jar时,提示“没有主清单属性”
创建:File->new->project->maven->GroupId:com.alex,ArtifaceId:mavendemo->project name:MvnDemo,finish->在main/java下创建Demo类->project structure->Artifacts->Jar->from module..->配置main class
用maven package时,会提示没有主清单,这时候改一下pom.xml即可
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.alex</groupId> <artifactId>mavendemo</artifactId> <version>1.0-SNAPSHOT</version> <!--<build>--> <!--<plugins>--> <!--<plugin>--> <!--<groupId>org.apache.maven.plugins</groupId>--> <!--<artifactId>maven-jar-plugin</artifactId>--> <!--<configuration>--> <!--<archive>--> <!--<manifest>--> <!--<mainClass>Demo</mainClass>--> <!--</manifest>--> <!--</archive>--> <!--</configuration>--> <!--</plugin>--> <!--</plugins>--> <!--</build>--> </project>
注释掉的即为增加的内容
7.ubuntu下载安装securecrt
下载:https://space.dingtalk.com/c/ggHaACQwZjRiNWM3Mi01NjYzLTRlMjgtOGQ4OC00NjVkMmVmYmQ2YTUCzhwy4JQ
http://www.cnblogs.com/yinchengzhe/p/5926645.html