使用root账号,用ollama安装即可,非常简单,记录如下:
(base) wensir@cs:~$ curl -fsSL https://ollama.com/install.sh | sh >>> Downloading ollama... ######################################################################## 100.0%#=#=-# # ######################################################################## 100.0% >>> Installing ollama to /usr/local/bin... [sudo] password for wensir: >>> Creating ollama user... >>> Adding ollama user to render group... >>> Adding ollama user to video group... >>> Adding current user to ollama group... >>> Creating ollama systemd service... >>> Enabling and starting ollama service... Created symlink /etc/systemd/system/default.target.wants/ollama.service → /etc/systemd/system/ollama.service. >>> Downloading AMD GPU dependencies... ######################################################################## 100.0%#=#=-# # ######################################################################## 100.0% >>> The Ollama API is now available at 127.0.0.1:11434. >>> Install complete. Run "ollama" from the command line. >>> AMD GPU ready. (base) wensir@cs:~$ ollama run llama3 pulling manifest pulling 6a0746a1ec1a... 89% ▕██████████████████████████████████████ ▏ 4.2 GB/4.7 GB 291 KB/s 28m24s
安装了两个model,一个是meta的llama3,另一个是microsoft的phi3,前者是8B参数(文件4GB),后者大概是几十亿参数(2.7GB)。所以llama3稍慢一点,phi3稍快一点。总体速度还是可以的。
如何查找硬盘的 UUID?这个UUID可用于准确mount之用
blkid
如何查看硬盘的 SMART 信息?
smartctl -a /dev/sda 重点关注 - Reallocated_Sector_Ct 为坏区重新分配的计数器(较重要,非零就可考虑换盘了) - Current_Pending_Sector 当前查明的坏块(非常重要,非零就可考虑换盘了) - Power_On_Hours 一共使用小时数 - Power_Cycle_Count 开关机次数 - Temperature_Celsius 硬盘温度
首先用root账户查看一下硬盘的设备名,并进入分区命令 parted
fdisk -l (或用 parted -l 也可以) parted /dev/sdd (进入 parted 环境) print (查看一下当前设备的情况)
然后构建一个label,通常对于大于2T的硬盘用gpt,可选的label有:aix, amiga, bsd, dvh, gpt, mac, ms-dos, pc98, sun, and loop
mklabel gpt print
然后就可以创建分区了,如果全盘就分一个区的话,这样做
mkpart primary ext4 0% 100% print
退出即可保存分区表,就这么简单!
quit
下面要format这个分区
mkfs -t ext4 /dev/sdd1
最后别忘了在/etc/fstab中加入相应条目,让它自动挂载
mkdir /home4 vi /etc/fstab 加入如下这样一行即可: /dev/sdd1 /home4 ext4 defaults 0 2
大功告成!
2022-July-13, I install MySQL + php extensions and setup my first WordPress
有关 MySQL 的安装和配置如下:
直接用apt安装MySQL apt install mysql-server 进入MySQL命令行环境 mysql -u root CREATE DATABASE wordpress; 创建一个给wp用的数据库wordpress CREATE USER wpuser IDENTIFIED BY 'your-password-here'; 添加一个用户wpuser和密码 GRANT ALL ON wordpress.* TO wpuser; 给wpuser用户赋予完全读写wordpress数据库的权力 FLUSH PRIVILEGES; 改动生效 EXIT
有关 PHP 的安装和配置如下:
系统原本就有apache2和php,其它是需要安装的,否则wordpress会报错说:php没有安装mysql的扩展插件 apt install apache2 \ ghostscript \ libapache2-mod-php \ mysql-server \ php \ php-bcmath \ php-curl \ php-imagick \ php-intl \ php-json \ php-mbstring \ php-mysql \ php-xml \ php-zip 此时务必重启一下计算机!
有关 WordPress 的安装和配置:
cp wp-config-sample.php wp-config.php vi wp-config.php 我改动了如下几处 define( 'DB_NAME', 'wordpress' ); define( 'DB_USER', 'wpuser' ); define( 'DB_PASSWORD', 'mysql中设置的wpuser的密码' ); $table_prefix = 'wp20220713_'; chown -R www-data:www-data wordpress 把wordpress整个目录的文件都设为www-data用户 打开浏览器,进入5分钟配置页面即可:http://climateserver.xxxx.xxx/wordpress/wp-admin/install.php 日后访问网页:http://climateserver.xxxx.xxx/wordpress 日后登录后台:http://climateserver.xxxx.xxx/wordpress/wp-login.php
2022-May-17, I strictly follow this page to configure WebDAV service within Apache2 framework: https://www.techrepublic.com/article/how-to-enable-webdav-on-your-ubuntu-server/
你可以这么使用webdav服务: url: http://climateserver.3322.org/webdav/[MakeOnePathHere] 实际是在/var/www/webdav/下建一个你的具体使用目录,然后连这个url即可 id: wensirwebdav pw: wxxxxxxx2xx0 经典pw
2021年10月17日,未知原因原来的NCL6虚拟环境不能用了,进不了ncl,于是决定重装
su - #必须切换到root账户 conda create -n NCL662 -c conda-forge ncl #就这一条命令即可完成安装NCL,6.6.2版是最新版
至此已经完成安装,以后用如下命令即可进入或退出NCL环境
conda activate NCL662 conda deactivate
老的NCL6环境,就删除吧
conda env list #查看有哪些环境 conda env remove --name NCL6
2021年8月22日,来到办公室发现cs已经关机了,估计是大楼断电导致了cs硬关机,唉,很为启动盘捏一把汗。果然,启动cs后,一大堆错误,第一遍甚至没起来。按reset键重启,在经历一大堆硬盘报错后,进入到登录画面了。登录,切换root,感觉还是不太正常。决定用fsck命令检查启动盘的所有错误。命令如下:
df -T -h # 检查各个盘的dev名,和fs类型(是否ext4?) fsck.ext4 /dev/sdc2 # sdc2就是ubuntu的系统盘,另外两块10T数据盘分别是sda1和sdb1 或者 fsck.ext4 -y /dev/sdc2 # 这可以省却很多按y(或直接按回车)的过程,整个检查过程,大概有几十个错误需要按回车
之后再重启,就没有问题了!God bless me!
##### Generate banner at /etc/motd (XW: Mar 6, 2020) www.patorjk.com/software/taag Input anything you want to show as hello banner Press "Test All" so that you can choose one touching you
语真反映yum安装的NCL画图会出现莫名其妙的问题,再加上历史遗留的load问题,索性干脆按照官网指导,用conda重新安一个NCL和专门给它独享的环境。
##### Re-Install NCL through conda (XW: Feb 22, 2020) follow this page: http://www.ncl.ucar.edu/Download/conda.shtml run this command to install NCL 6.6.2 into an environment named "NCL6" conda create -n NCL6 -c conda-forge ncl Please note that everyone, for everytime, should run "conda activate NCL6" right before using NCL. "conda deactivate" or not doesn't matter.
机器时区默认是错的,故手工修改一下时区信息
##### Reset Timezone timedatectl set-timezone Asia/Shanghai timedatectl (this command will show below outputs) (base) root@cs:~# timedatectl Local time: Mon 2019-11-04 14:45:17 CST Universal time: Mon 2019-11-04 06:45:17 UTC RTC time: Mon 2019-11-04 06:45:17 Time zone: Asia/Shanghai (CST, +0800) System clock synchronized: yes systemd-timesyncd.service active: yes RTC in local TZ: no
##### Python3 w/ Anaconda Download Anaconda3-2019.10-Linux-x86_64.sh from tuna.tsinghua and install it After installation, it is shown: ----- installation finished. Do you wish the installer to initialize Anaconda3 by running conda init? [yes|no] [no] >>> yes no change /opt/anaconda3/condabin/conda no change /opt/anaconda3/bin/conda no change /opt/anaconda3/bin/conda-env no change /opt/anaconda3/bin/activate no change /opt/anaconda3/bin/deactivate no change /opt/anaconda3/etc/profile.d/conda.sh no change /opt/anaconda3/etc/fish/conf.d/conda.fish no change /opt/anaconda3/shell/condabin/Conda.psm1 no change /opt/anaconda3/shell/condabin/conda-hook.ps1 no change /opt/anaconda3/lib/python3.7/site-packages/xontrib/conda.xsh no change /opt/anaconda3/etc/profile.d/conda.csh modified /root/.bashrc ==> For changes to take effect, close and re-open your current shell. <== If you'd prefer that conda's base environment not be activated on startup, set the auto_activate_base parameter to false: conda config --set auto_activate_base false Thank you for installing Anaconda3! -----
之后用conda装一个basemap,以方便慕琦使用python画地图
##### Install basemap package for anaconda/base (XW: Mar 4, 2020) conda install basemap
此外,有些package用conda没法安装,使用pip做如下补充:
##### pip install pip install pygame pip install nikola pelican
##### Tools apt install lftp apt install tcsh apt install vim nano (already installed by default) apt install htop (already installed) apt install dfc apt install tree apt install mc apt install unrar apt install pandoc a2ps apt install img2pdf apt install boxes figlet toilet cowsay apt install sl apt install sysbench (sysben --test=cpu|memory|fileio run) apt install cockpit (a simple admin tool via web by listening port 9090 w/ htpps) apt install aha apt install ffmpeg (a comprehensive tool for video/audio converting stuff) ##### Work apt install openjdk-8-jdk openjdk-8-doc apt install openjdk-8-source openjdk-8-dbg # optional apt install gcc g++ gfortran apt install ncl-ncarg apt install octave apt install netcdf-bin pnetcdf-bin apt install ncview apt install nco cdo (HUGE! 1.2G) apt install grads apt install gnuplot apt install imagemagick apt install gv xpdf mupdf apt install feh ##### Network apt install aria2 tranmission-cli Download tool, support magnetic torrent apt install firefox apt install w3m apt install apache2 a2enmod userdir Open HTTP for each user under ~/public_html systemctl restart apache2 Restart HTTP service apt install php apt install shellinabox service shellinabox status service shellinabox start vi /etc/default/shellinabox if you want to change the default port 4200 apt install vsftpd systemctl status vsftpd systemctl start vsftpd systemctl enable vsftpd
2019年11-12月,永霖和新宇采购并安装配置了全新的climateserver服务器(以下简称cs),硬件参数如下: