C/C++, Python, Java, MySQL, Fortran, Perl under Debian GNU/Linux

13 篇文章 0 订阅
1 篇文章 0 订阅
fdisk-l
mount /dev/sdb4 /mnt
cd /mnt
mkdir fordername
cd fordername
cp hello.cpp /home/username
cp hello.cpp /mnt/fordername

Debian GNU/Linux
(WSL) Windows Subsystem for Linux
C:\Users\username\AppData\Local\Packages\TheDebianProject.DebianGNULinux_*\LocalState\rootfs
sudo passwd
su root

vi /etc/apt/sources.list

# https://www.cnblogs.com/liuguanglin/p/9397428.html

sudo apt-get install ca-certificates
sudo apt-get install apt-transport-https
sudo apt-get update

#  installing base compile tools

sudo apt-get install sudo vim perl gcc g++ gfortran default-jdk

# install java jdk

# sudo apt-get install default-jre default-jdk
# apt-cache search openjdk
# sudo apt-get install openjdk-11-jdk

# install python

sudo apt-get install python3 python3-pip python3-numpy python3-scipy python3-sympy python3-matplotlib

sudo apt-get install python3-pip python3-numpy python3-scipy

pip list

python3 --version

# install MySQL

sudo apt-get install mariadb-server mariadb-client
python3 –m pip install mysql-connector pymysql
sudo apt-get install mysql-server mysql-client
python –m pip install mysql-connector pymysql

 # python connect mysql

Python3 MySQL(mysql-connector)
Python3 –m pip install mysql-connector
# https://www.runoob.com/python3/python-mysql-connector.html

#

Python3 MySQL(PyMySQL)
pip3 install PyMySQL
# https://www.runoob.com/python3/python3-mysql.html
#
# Linux GUI
# 1. install apps

sudo apt-get install xorg xfce4 xrdp

# 2. set port 3390

sudo sed -i 's/port=3389/port=3390/g' /etc/xrdp/xrdp.ini

# 3. to xsession write xfce4-session

sudo echo xfce4-session >~/.xsession

# 4. restart xrdp service

sudo service xrdp restart
# iproute2
# ip address show | ip addr show | ip ad sh
ip ad sh

# https://www.cnblogs.com/pachulia/p/9239504.html

# cmd run 

ipconfig /all

vim hello.f90

program

      print "Hello World"

end progr


# Perl
vim hello.pl
print “Hello world!\n”;
perl hello.pl
# C/C++
vim hello.c
#include <stdio.h>
Int main(int argc, char* argv[])
{
    Printf(“Hello World!\n”);
}
gcc hello.c // a.out
./a.out
#
gcc –c hello.c // hello.o
gcc hello.o –o hello // hello
./hello
# makefile
objects = main.o
hello: $(objects)
      gcc –o hello $(objects)
.PHONY: clean
clean:
           -rm –rf hello $(objects)
# Java
# apt-cache search openjdk
# sudo apt-get install openjdk-11-jdk

vim hello.java
public class hello {
     public static void main(String [] args) {
            System.out.println (“hello world!”)
     }
}
javac hello.java
java hello

# Python
vim hello.py

print(“Hello World!”);

python3 hello.py
# Python GUI Programming

import matplotlib as mpl
mpl.use('TkAgg')         # mpl.use('QT5Agg')
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0,6,0.01)
y = np.sin(x)
plt.plot(x,y)
plt.show()

# https://www.linuxidc.com/Linux/2018-03/151117.htm
#
from pylab import show
show()

#
# MySQL
 

service mysql start
# or /etc/init.d/mysql start
mysql
mysqladmin –u root –p password ‘086021’
mysql –u root –pgrant usage on *.* to 'user01'@'localhost' identified by '123456' with grant option;  // add user
grant all privileges on *.* to 'user01'@'localhost' identified by '123456';  // add grant
flush privileges; // update grant

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值