Npm install with sudo safe perm
sudo npm install -g eslint --unsafe-perm=true --allow-root
January 09, 2019 Roy 0 Comments
sudo npm install -g eslint --unsafe-perm=true --allow-root
January 09, 2019 Roy 0 Comments
sudo /etc/init.d/mysql stop
sudo mkdir /var/run/mysqld/
sudo chown mysql /var/run/mysqld/
sudo mysqld_safe --skip-grant-tables &
richard@ubuntu1710:~$ 2017-12-25T16:49:30.551520Z mysqld_safe Logging to syslog.
2017-12-25T16:49:30.554646Z mysqld_safe Logging to '/var/log/mysql/error.log'.
2017-12-25T16:49:30.578079Z mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
2017-12-25T16:49:32.568746Z mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[1]+ Done sudo mysqld_safe --skip-grant-tables
sudo mysql -u root
use mysql;
mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
update user set authentication_string=PASSWORD("New_Passwore_Here")where User='root';
flush privileges; exit;
sudo /etc/init.d/mysql stop sudo /etc/init.d/mysql start
sudo mysql -u root -p
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 5 Server version: 5.7.20-0ubuntu0.17.10.1 (Ubuntu) Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
January 06, 2019 Roy 0 Comments
[Unit] | |
Description = Java Service | |
After network.target = MyService.service | |
[Service] | |
Type = forking | |
ExecStart = /usr/local/bin/MyService.sh start | |
ExecStop = /usr/local/bin/MyService.sh stop | |
ExecReload = /usr/local/bin/MyService.sh reload | |
[Install] | |
WantedBy=multi-user.target |
#!/bin/sh | |
SERVICE_NAME=MyService | |
PATH_TO_JAR=/usr/local/MyProject/MyJar.jar | |
PID_PATH_NAME=/tmp/MyService-pid | |
case $1 in | |
start) | |
echo "Starting $SERVICE_NAME ..." | |
if [ ! -f $PID_PATH_NAME ]; then | |
nohup java -jar $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null & | |
echo $! > $PID_PATH_NAME | |
echo "$SERVICE_NAME started ..." | |
else | |
echo "$SERVICE_NAME is already running ..." | |
fi | |
;; | |
stop) | |
if [ -f $PID_PATH_NAME ]; then | |
PID=$(cat $PID_PATH_NAME); | |
echo "$SERVICE_NAME stoping ..." | |
kill $PID; | |
echo "$SERVICE_NAME stopped ..." | |
rm $PID_PATH_NAME | |
else | |
echo "$SERVICE_NAME is not running ..." | |
fi | |
;; | |
restart) | |
if [ -f $PID_PATH_NAME ]; then | |
PID=$(cat $PID_PATH_NAME); | |
echo "$SERVICE_NAME stopping ..."; | |
kill $PID; | |
echo "$SERVICE_NAME stopped ..."; | |
rm $PID_PATH_NAME | |
echo "$SERVICE_NAME starting ..." | |
nohup java -jar $PATH_TO_JAR /tmp 2>> /dev/null >> /dev/null & | |
echo $! > $PID_PATH_NAME | |
echo "$SERVICE_NAME started ..." | |
else | |
echo "$SERVICE_NAME is not running ..." | |
fi | |
;; | |
esac |
0 comments: