顯示具有 ubuntu 標籤的文章。 顯示所有文章
顯示具有 ubuntu 標籤的文章。 顯示所有文章

2025年7月19日 星期六

Linux Mint / Ubuntu 的 GPG error

VSCode

 參考這篇 https://medium.com/@lpramithamj/fixing-the-gpg-key-error-for-visual-studio-code-on-ubuntu-f29562a38182

 How to Fix the GPG Key Error

Step 1: Download and Install the Microsoft GPG Key 

 wget -qO - https://packages.microsoft.com/keys/microsoft.asc | sudo gpg --dearmor -o /usr/share/keyrings/microsoft.gpg

Step 2: Update the Microsoft Repository List

echo "deb [signed-by=/usr/share/keyrings/microsoft.gpg arch=amd64] https://packages.microsoft.com/repos/code stable main" | sudo tee /etc/apt/sources.list.d/vscode.list

Step 3: Update and Upgrade Packages

sudo apt update && sudo apt upgrade -y

以上動作應該就可以修正 VSCode 的問題。

 

 

 

 

 

 

2025年4月2日 星期三

ubuntu 24.04 install LAMP

 

sudo apt update
sudo apt upgrade

sudo apt install apache2 mariadb-server php8.3-fpm php8.3 libapache2-mod-php8.3 php8.3-common php8.3-mysql php8.3-xml php8.3-xmlrpc php8.3-curl php8.3-gd php8.3-imagick php8.3-cli php8.3-imap php8.3-mbstring php8.3-opcache php8.3-soap php8.3-zip php8.3-intl php8.3-bcmath unzip phpmyadmin python3-certbot-apache

sudo systemctl enable apache2
apache2 -v

sudo systemctl enable mariadb
sudo mysql_secure_installation
mariadb --version
sudo mysql -uroot -p
grant all on *.* to root@localhost identified by '123456';


sudo gedit /etc/php/8.1/apache2/php.ini
  upload_max_filesize = 2000M
  max_file_uploads = 2000
  post_max_size = 2000M
  max_execution_time = 600
  max_input_time = 1000
  max_input_vars = 3000
  memory_limit = 1024M
  session.gc_maxlifetime = 86400







2024年7月18日 星期四

Adjust Trackpoint speed on Ubuntu 22.04

 ref: https://askubuntu.com/questions/1432996/adjust-trackpoint-speed-on-lenovo-p70-ubuntu-22-04


Here's what worked for me; your mileage may vary. First, find your device:

$ xinput list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ TPPS/2 IBM TrackPoint                     id=12   [slave  pointer  (2)]
⎜   ↳ Synaptics TM3053-004                      id=11   [slave  pointer  (2)]
⎜   ↳ ELAN Touchscreen                          id=9    [slave  pointer  (2)]
...

On my system, I see it as TPPS/2 IBM TrackPoint. Next, find the acceleration property:

$ xinput list-props 'TPPS/2 IBM TrackPoint' | grep Accel
    libinput Accel Speed (342): 0.000000
    libinput Accel Speed Default (343): 0.000000
    libinput Accel Profiles Available (344):    1, 1
    libinput Accel Profile Enabled (345):   1, 0
    libinput Accel Profile Enabled Default (346):   1, 0

Here, I see it as Accel Speed (342), and the 342 is what I need. After some experimentation, I was able to determine that the value, by default 0.000000 is expected to be in the range [-1, 1]. For me, -0.2 ended up being a good speed:

$ xinput set-prop 'TPPS/2 IBM TrackPoint' 342 -0.2
 
 

2023年11月1日 星期三

ubuntu 22.04 disable trackpoint middle button paste

 ref: https://gist.github.com/bumbummen99/fcab50dad5638399375693a70a8c17f4

先執行 

xinput --list

確認 TrackPoint 的 id 是多少,假設是 15,就執行以下指令:

xinput set-button-map 15 1 0 3 4 5 6 7

就可以關掉中鍵貼上的動作了。

2022年9月16日 星期五

Greenbone Community Edition ( GSA, 舊名 OpenVAS) 的安裝方式

 建議使用全新的 Ubuntu 22.04 的系統環境,安裝流程參閱以下文章。

官方安裝文件:

https://greenbone.github.io/docs/latest/22.4/source-build/index.html

2022年6月3日 星期五

Ubuntu 裡的 vscode 指定 Mono 字型

 我個人在 Font Family 的設定如下:

'Noto Sans Mono CJK TC','Consolas','Droid Sans Mono', 'monospace', monospace


其中,Noto Sans Mono CJK TC 這樣就好,不用再加 Regular 或 Bold ,就可以做到中英文完全對齊了。

2022年3月31日 星期四

Dell Precision 3650 tower 安裝 ubuntu 20.04 or Linux Mint 20 的 NIC driver

 Dell Precision 3650 tower 的網路卡是 Intel I219-LM 整合型的網路卡,可以參考 https://askubuntu.com/questions/1344156/ubuntu-20-04-2-and-onboard-intel-i219-v 的內容進行。

若系統更新 kernel 的話,還需要重新再執行一次。

2022年2月25日 星期五

Lenovo Trackpoint II Keyboard 在 Ubuntu 的設定

 參考 https://github.com/telecastr/tp2ctl 的做法,很容易可以設定 外接 Lenovo Trackpoint II Keyboard 的 Trackpoint 。


2021年1月26日 星期二

Jitsi Meet

 

2022.12.12 更新

 參考 https://jitsi.github.io/handbook/docs/devops-guide/devops-guide-quickstart

選用 ubuntu 20.04 LTS 版本來安裝。

 

=============================

作業系統最好使用 ubuntu LTS 版本。

參考以下方式安裝~ 

https://www.tecmint.com/install-jitsi-meet-on-debian-and-ubuntu/

 

2020年6月13日 星期六

ubuntu 18.04 / Linux mint 19.3 setting trackpoint acceleration


Disabling the acceleration profile helps:
xinput --set-prop 'TPPS/2 IBM TrackPoint' 'libinput Accel Profile Enabled' 0, 1

Then you might want to increase your pointer's speed:
xinput --set-prop 'TPPS/2 IBM TrackPoint' 'libinput Accel Speed' 1

Since the next startup the acceleration profile will be enabled again by default you can create a script that includes the above commands and is run automatically after restart.

ref: https://askubuntu.com/questions/1029119/erratic-behaviour-of-trackpoint-on-thinkpad-t420s-ubuntu-18-04

2020年6月12日 星期五

ubuntu 20.04 trackpoint setting


確認一下系統的配置,找到 TrackPoint 的項目,底下就要依該項目來查詢

xinput --list

 列出該 TrackPoint 項目的屬性

xinput --list-props "ETPS/2 Elantech TrackPoint"

 

設定 該項目的屬性值

 xinput --set-prop "ETPS/2 Elantech TrackPoint" "libinput Accel Speed" 1.0

ref: https://wiki.archlinux.org/index.php/TrackPoint

ubuntu 20.04 install LAMP

sudo apt update
sudo apt upgrade
sudo apt install apache2 apache2-utils mariadb-server mariadb-client php7.4 libapache2-mod-php7.4 php7.4-mysql php-common php7.4-zip php7.4-cli php7.4-common php7.4-json php7.4-gmp php7.4-bcmath php-imagick php7.4-intl php7.4-opcache php7.4-readline phpmyadmin



sudo systemctl enable apache2
apache2 -v

sudo systemctl enable mariadb
sudo mysql_secure_installation
mariadb --version
sudo mysql -uroot -p
grant all on *.* to root@localhost identified by '123456';

sudo a2enmod php7.4
sudo systemctl restart apache2
php --version


sudo ufw status
sudo ufw default allow outgoing
sudo ufw default deny incoming
;sudo ufw allow ssh
sudo ufw enable

2019年5月25日 星期六

How to Install Wine 4.0 on Ubuntu 18.04 & 16.04 LTS


參考以下內容:

https://tecadmin.net/install-wine-on-ubuntu/

以 ubuntu 16.04 版本為例的話,指令如下:

sudo dpkg --add-architecture i386
wget -qO - https://dl.winehq.org/wine-builds/winehq.key | sudo apt-key add -
sudo apt-add-repository 'deb https://dl.winehq.org/wine-builds/ubuntu/ xenial main'
sudo apt-get update
sudo apt-get install --install-recommends winehq-stable
wine --version

2018年7月29日 星期日

ubuntu 1804 的 php 升級為 php7.2

sudo apt-get install apache2 mariadb-server mariadb-client php7.2  libapache2-mod-php7.2 php7.2-mysql phpmyadmin php7.2-curl php7.2-gd  php-pear  php-imagick  php7.2-imap php-memcache  php7.2-pspell php7.2-recode php7.2-snmp php7.2-sqlite3 php7.2-tidy php7.2-xmlrpc php7.2-xsl php-mbstring php7.2-mbstring php-gettext p7zip* fcitx-table-scj6 fcitx-config-gtk shutter vlc kdenlive kazam gimp audacious






PHP 7.2 將 mcrypt 移除了,建議使用 Openssl 來取代




另, 預設 mysql 不會要我們輸入密碼, 所以, 在啟動後, 要 sudo mysql -uroot -p 不用密碼直接登入, 再用 grant all on *.* to root@localhost identified by '123456';  指定新的密碼.

2017年1月22日 星期日

Unity on Linux


unity3d 官方網站提供 Windows 及 Mac 版本的軟體,不過,在官方的 blog 裡也提供了 for Linux 版本的 unity。
第一個發佈的版本在 Unity Comes to Linux: Experimental Build Now Available 這裡可以下載,這裡提供 5.1.0 的版本。
如果要找更新的版本,可以從 Unity on Linux: Release Notes and Known Issues 這裡找到。

依據您的 Linux 版本不同,不見得適合最新版本,這部份您要自己測試了。以我自己為例,我有二台筆電,都裝 Ubuntu 14.04 ,其中一台不能裝到這時最新的 5.5版本,勉強能裝 5.4版,但還是有些狀況,比較穩定的版本是 unity 5.1,不過,另一台就可以很順利的安裝 5.5,而且啟動操作都沒問題,也許是我這二台系統本身所安裝的套件也有些小小差異所影響。

Linux 下的 unity 預設沒有 standard assets,不過,可以由 Asset Store 自行下載安裝,沒問題。
由 Asset Store 下載的套件,預設存放在 ~/.local/share/unity3d/Asset Store-5.x/Unity Technologies/Unity EssentialsAsset Packs/ 底下,請自行備份出來,方便下回使用。

2016年7月15日 星期五

ubuntu 1604 的 php 升級為 php7.0 了


sudo apt-get install apache2 mariadb-server mariadb-client php7.0  libapache2-mod-php7.0 php7.0-mysql phpmyadmin php7.0-curl php7.0-gd  php-pear  php-imagick  php7.0-imap php7.0-mcrypt php-memcache  php7.0-pspell php7.0-recode php7.0-snmp php7.0-sqlite3 php7.0-tidy php7.0-xmlrpc php7.0-xsl php-mbstring php7.0-mbstring php-gettext p7zip*

另, 預設 mysql 不會要我們輸入密碼, 所以, 在啟動後, 要 sudo mysql -uroot -p 不用密碼直接登入, 再用 grant all on *.* to root@localhost identified by '123456';  指定新的密碼.

底下這篇還滿詳細的
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-on-ubuntu-16-04
http://www.geoffstratton.com/ubuntu-1604-web-server-nginx-mariadb-redis-and-drupal-7

2015年5月17日 星期日

在 ubuntu 14.04 安裝及啟用 python + django 以及 啟用 apache 的 mod_wsgi 模組



ref: https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04

以下為網頁備份資料。

How To Serve Django Applications with Apache and mod_wsgi on Ubuntu 14.04

Tags: Apache, Django, Python, Python Frameworks Distribution: Ubuntu

Introduction

Django is a powerful web framework that can help you get your Python application or website off the ground quickly. Django includes a simplified development server for testing your code locally, but for anything even slightly production related, a more secure and powerful web server is required.
In this guide, we will demonstrate how to install and configure Django in a Python virtual environment. We'll then set up Apache in front of our application so that it can handle client requests directly before passing requests that require application logic to the Django app. We will do this using the mod_wsgi Apache module that can communicate with Django over the WSGI interface specification.

Prerequisites and Goals

In order to complete this guide, you should have a fresh Ubuntu 14.04 server instance with a non-root user with sudo privileges configured. You can learn how to set this up by running thorugh our initial server setup guide.
We will be installing Django within a Python virtual environment. Installing Django into an environment specific to your project will allow your projects and their requirements to be handled separately.
Once we have our application up and running, we will configure Apache to interface with the Django app. It will do this with the mod_wsgi Apache module, which can translate HTTP requests into a predictable application format defined by a specification called WSGI. You can find out more about WSGI by reading the linked section on this guide.
Let's get started.

Install Packages from the Ubuntu Repositories

To begin the process, we'll download and install all of the items we need from the Ubuntu repositories. This will include the Apache web server, the mod_wsgi module used to interface with our Django app, and pip, the Python package manager that can be used to download our Python-related tools.
To get everything we need, update your server's local package index and then install the appropriate packages:
sudo apt-get update
sudo apt-get install python-pip apache2 libapache2-mod-wsgi

Configure a Python Virtual Environment

Now that we have the components from the Ubuntu repositories, we can start working on our Django project. The first step is to create a Python virtual environment so that our Django project will be separate from the system's tools and any other Python projects we may be working on.
We need to install the virtualenv command to create these environments. We can get this using pip:
sudo pip install virtualenv
With virtualenv installed, we can start forming our project. Create a directory where you wish to keep your project and move into the directory:
mkdir ~/myproject
cd ~/myproject
Within the project directory, create a Python virtual environment by typing:
virtualenv myprojectenv
This will create a directory called myprojectenv within your myproject directory. Inside, it will install a local version of Python and a local version of pip. We can use this to install and configure an isolated Python environment for our project.
Before we install our project's Python requirements, we need to activate the virtual environment. You can do that by typing:
source myprojectenv/bin/activate
Your prompt should change to indicate that you are now operating within a Python virtual environment. It will look something like this: (myprojectenv)user@host:~/myproject$.
With your virtual environment active, install Django with the local instance of pip by typing:
pip install django

Create and Configure a New Django Project

Now that Django is installed in our virtual environment, we can create the actual Django project files.

Create the Django Project

Since we already have a project directory, we will tell Django to install the files here. It will create a second level directory with the actual code, which is normal, and place a management script in this directory. The key to this is the dot at the end that tells Django to create the files in the current directory:
django-admin.py startproject myproject .

Adjust the Project Settings

The first thing we should do with our newly created project files is adjust the settings. Open the settings file with your text editor:
nano myproject/settings.py
We are going to be using the default SQLite database in this guide for simplicity's sake, so we don't actually need to change too much. We will focus on configuring the static files directory, where Django will place static files so that the web server can serve these easily.
At the bottom of the file, we will add a line to configure this directory. Django uses the STATIC_ROOT setting to determine the directory where these files should go. We'll use a bit of Python to tell it to use a directory called "static" in our project's main directory:
STATIC_ROOT = os.path.join(BASE_DIR, "static/")
Save and close the file when you are finished.

Complete Initial Project Setup

Now, we can migrate the initial database schema to our SQLite database using the management script:
cd ~/myproject
./manage.py makemigrations
./manage.py migrate
Create an administrative user for the project by typing:
./manage.py createsuperuser
You will have to select a username, provide an email address, and choose and confirm a password.
We can collect all of the static content into the directory location we configured by typing:
./manage.py collectstatic
You will have to confirm the operation. The static files will be placed in a directory called static within your project directory.
Finally, you can test your project by starting up the Django development server with this command:
./manage.py runserver 0.0.0.0:8000
In your web browser, visit your server's domain name or IP address followed by :8000:
http://server_domain_or_IP:8000
You should see the default Django index page:
Django default index
If you append /admin to the end of the URL in the address bar, you will be prompted for the administrative username and password you created with the createsuperuser command:
Django admin login
After authenticating, you can access the default Django admin interface:
Django admin interface
When you are finished exploring, hit CTRL-C in the terminal window to shut down the development server.
We're now done with Django for the time being, so we can back out of our virtual environment by typing:
deactivate

Configure Apache

Now that your Django project is working, we can configure Apache as a front end. Client connections that it receives will be translated into the WSGI format that the Django application expects using the mod_wsgi module. This should have been automatically enabled upon installation earlier.
To configure the WSGI pass, we'll need to edit the default virtual host file:
sudo nano /etc/apache2/sites-available/000-default.conf
We can keep the directives that are already present in the file. We just need to add some additional items.
To start, let's configure the static files. We will use an alias to tell Apache to map any requests starting with /static to the "static" directory within our project folder. We collected the static assets there earlier. We will set up the alias and then grant access to the directory in question with a directory block:

    . . .

    Alias /static /home/user/myproject/static
    user
/myproject/static> Require all granted Next, we'll grant access to the wsgi.py file within the second level project directory where the Django code is stored. To do this, we'll use a directory section with a file section inside. We will grant access to the file inside of this nested construct:

    . . .

    Alias /static /home/user/myproject/static
    user
/myproject/static> Require all granted user/myproject/myproject> Require all granted After this is configured, we are ready to construct the portion of the file that actually handles the WSGI pass. We'll use daemon mode to run the WSGI process, which is the recommended configuration. We can use the WSGIDaemonProcess directive to set this up.
This directive takes an arbitrary name for the process. We'll use myproject to stay consistent. Afterwards, we set up the Python path where Apache can find all of the components that may be required. Since we used a virtual environment, we will have to set up two path components. The first is our project's parent directory, where the project files can be found. The second is the lib/pythonx.x/site-packages path within our virtual environment folder (where the Xs are replaced by the Python version number components). This way, Apache can find all of the other Python code needed to run our project.
Afterwards, we need to specify the process group. This should point to the same name we selected for the WSGIDaemonProcess directive (myproject in our case). Finally, we need to set the script alias so that Apache will pass requests for the root domain to the wsgi.py file:

    . . .

    Alias /static /home/user/myproject/static
    user
/myproject/static> Require all granted user/myproject/myproject> Require all granted WSGIDaemonProcess myproject python-path=/home/user/myproject:/home/user/myproject/myprojectenv/lib/python2.7/site-packages WSGIProcessGroup myproject WSGIScriptAlias / /home/user/myproject/myproject/wsgi.py When you are finished making these changes, save and close the file.

Wrapping Up Some Permissions Issues

If you are using the SQLite database, which is the default used in this article, you need to allow the Apache process access to this file.
To do so, the first step is to change the permissions so that the group owner of the database can read and write. The database file is called db.sqlite3 by default and it should be located in your base project directory:
chmod 664 ~/myproject/db.sqlite3
Afterwards, we need to give the group Apache runs under, the www-data group, group ownership of the file:
sudo chown :www-data ~/myproject/db.sqlite3
In order to write to the file, we also need to give the Apache group ownership over the database's parent directory:
sudo chown :www-data ~/myproject
Once these steps are done, you are ready to restart the Apache service to implement the changes you made. Restart Apache by typing:
sudo service apache2 restart
You should now be able to access your Django site by going to your server's domain name or IP address without specifying a port. The regular site and the admin interface should function as expected.

Conclusion

In this guide, we've set up a Django project in its own virtual environment. We've configured Apache with mod_wsgi to handle client requests and interface with the Django app.
Django makes creating projects and applications simple by providing many of the common pieces, allowing you to focus on the unique elements. By leveraging the general tool chain described in this article, you can easily serve the applications you create from a single server.


2015年4月25日 星期六

Enable 3D HW acceleration on VMWare Workstation 10 on Ubuntu 14.04


ref: http://askubuntu.com/questions/537787/enable-3d-hw-acceleration-on-vmware-workstation-10-on-ubuntu-14-04

在 ubuntu 1404 版本裡,使用 vmware 時, 要將其中的系統啟用 3D 加速功能,如果只是勾選設定檔的 3D 加速,可能還是沒有作用, 必須手動指定。
參考前述連結, 使用 gedit ~/.vmware/preferences 編輯檔案, 加上 mks.gl.allowBlacklistedDrivers = TRUE 這一行, 再重新啟動 vm 裡的系統,就可以支援 3D 加速了。


2014年11月27日 星期四

Ubuntu 幾個好用的工具


今天看到一篇 介紹 ubuntu 裡的幾個好用的工具,很不錯!

11 Useful Utilities To Supercharge Your Ubuntu Experience

ref: http://www.omgubuntu.co.uk/2014/11/useful-tools-for-ubuntu-do-you-use-them

主要介紹以下幾個軟體:
  1. Unity Tweak Tool
  2. Unity Privacy Indicator
  3. Unity Folders
  4. Caffeine
  5. System Monitor Indicator
  6. Power Saving Tools for Linux Laptops
  7. Intel Graphics Installer
  8. Hardware Stats
  9. Disk Space Visualizer
  10. BleachBit (Cruft Cleaner)