[2018.07.23 learning notes] [linux advanced knowledge Shell script programming exercise]

1. Write shell script to calculate the sum of 1-100; #!/bin/bash sum=0 for i in `seq 1 100` do sum=$[$sum+$i] done echo $sum 2. Write a shell script, ask to input a number, and then calculate the sum from 1 to the input number. If the input number is less than 1, input again until the correct number is input; #!/bin/bash n=0 while [ $n -lt " ...

Added by krraleigh on Fri, 31 Jan 2020 16:17:42 +0200

Use a cURL with a username and password?

I want to access a URL that requires a username/password.I want to try it curl Access it.Now I'm doing something similar: curl http://api.somesite.com/test/blah?something=123 I got an error.I think I need to specify a username and password as well as the above commands. How can I do this? ...

Added by amirbwb on Fri, 31 Jan 2020 05:06:12 +0200

Mariadb changes the root password and skips the authorization mode to start the database

Mariadb changes the root password By default, the password of the newly installed mariadb is empty. You can log in to the database by directly entering mysql in the shell terminal. If it is the first time you have just installed it, use the MySQL? Secure? Installation command to initialize it. # mysql_secure_installation NO ...

Added by mraza on Mon, 27 Jan 2020 17:54:03 +0200

When postgresql compiles source code, add configuration options in precompiled configure

Absrtact: This article mainly talks about how to add a configuration option for the auto precompiled script configure in the source code of Postgresql and find a simple example to illustrate. In the src/include/storage/proc.h header file, add an array of bytes occupied by the PGXACT structure.   1. First, take a look at a pic ...

Added by olsrey on Wed, 22 Jan 2020 17:46:30 +0200

Insert pdf file in latex

I want to insert PDF or doc file as appendix in my latex file. Do you know what I do? #1 building \includegraphics{myfig.pdf} #2 building Use pdfpages Bag. \usepackage{pdfpages} To include all pages in a PDF file: \includepdf[pages=-]{myfile.pdf} First page of PDF only: \includepdf[pages={1}]{myfile.pdf} Run texdoc pd ...

Added by thebadbad on Tue, 21 Jan 2020 17:50:45 +0200

Centos7 configures SVN server

Environmental Science Centos 7 SVN 1.7 Install SVN Shell> yum install svn -y Prepare configuration and warehouse Shell> mkdir -p /mydata/repo Shell> cd /mydata/repo/ Shell> svnadmin create erp  #Create a code base, here take erp as an example The configuration file of the code ba ...

Added by bdee1 on Mon, 20 Jan 2020 09:33:04 +0200

Version compatibility of PyTorch and TensorboardX

1. Version compatibility between PyTorch and TensorboardX In the use of tensorflow, people often use tensorboard to visualize data, such as the change of model structure and loss function. In fact, PyTorch can also use TensorboardX to visualize data. PyTorch has its own visdom module to realize visual ...

Added by allelopath on Fri, 10 Jan 2020 16:44:03 +0200

On Mac, kill the process regularly according to the process name / restart the process by the way of Daemons

Reference blogger article https://blog.csdn.net/u010976445/article/details/50819287 To kill and restart pycharm program under Mac as an example to write script, using Python 3.6 environment 1, Kill process ps -ef | grep pycharm | awk '{print $2}' | xargs kill -9  # After ps -ef | grep pycharm | awk '{print }' | xargs is exe ...

Added by weedo on Mon, 06 Jan 2020 19:23:08 +0200

Grant ** all ** database permissions

I created a database, such as'mydb'. CREATE DATABASE mydb CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'myuser'@'%' IDENTIFIED BY PASSWORD '*HASH'; GRANT ALL ON mydb.* TO 'myuser'@'%'; GRANT ALL ON mydb TO 'myuser'@'%'; GRANT CREATE ON mydb TO 'myuser'@'%'; FLUSH PRIVILEGES; Now I can log in to the database from anywhere, but I can't ...

Added by doforumda on Sun, 05 Jan 2020 23:38:02 +0200

pyinstaller packages the GUI program written by PySide2 and calls ffmpeg to hide the CMD console solution

1 Problem Description Write a GUI program using PySide2, call ffmpeg command line tool, do simple batch video processing (adjust frame width, frame height, video speed, reduce video bitrate to limit video size), use ffmpeg, ffmpeg-python library; It was easy, but I had a problem: When pyinstaller packages: Without -w or--noconsole, there are ...

Added by Sephiriz on Sun, 05 Jan 2020 22:37:36 +0200