Skip to main content

a silhouette of a person's head and shoulders, used as a default avatar

Linux perf and KCachegrind

If you occassionally do performance profiling as I do, you probably know Valgrind's Callgrind and the related UI KCachegrind. While Callgrind is a pretty powerful tool, running it takes quite a while (not exactly fun to do with something as big as e.g. LibreOffice).

Recently I finally gave Linux perf a try. Not quite sure why I didn't use it before, IIRC when I tried it somewhen long ago, it was probably difficult to set up or something. Using perf record has very little overhead, but I wasn't exactly thrilled by perf report. I mean, it's text UI, and it just gives a list of functions, so if I want to see anything close to a call graph, I have to manually expand one function, expand another function inside it, expand yet another function inside that, and so on. Not that it wouldn't work, but compared to just looking at what KCachegrind shows and seeing ...

When figuring out how to use perf, while watching a talk from Milian Wolff, on one slide I noticed a mention of a Callgrind script. Of course I had to try it. It was a bit slow, but hey, I could finally look at perf results without feeling like that's an effort. Well, and then I improved the part of the script that was slow, so I guess I've just put the effort elsewhere :).

And I thought this little script might be useful for others. After mailing Milian, it turns out he just created the script as a proof of concept and wasn't interested in it anymore, instead developing Hotspot as UI for perf. Fair enough, but I think I still prefer KCachegrind, I'm used to this, and I don't have to switch the UI when switching between perf and callgrind. So, with his agreement, I've submitted the script to KCachegrind. If you would find it useful, just download this do something like:

$ perf record -g ...
$ perf script -s perf2calltree.py > perf.out
$ kcachegrind perf.out



the avatar of Chun-Hung sakana Huang

使用 Ansible 建立 容器化 GitLab with openSUSE in Azure 小記

使用 Ansible 建立 容器化 GitLab with openSUSE in Azure 小記

OS: openSUSE Leap 15 in Azure

今天來測試使用 ansible 在 Azure 上面透過容器化的方式建立 GitLab

GitLab 官方建議規格

先來試試看網路上搜尋到的方式
首先試試看沒有掛在 volume 的方式

$docker  run  -d  --hostname  gitlab.example.com  -p  443:443  -p  80:80  --name  gitlab --restart always  gitlab/gitlab-ce:latest

這樣的方式可以將 GitLab 啟動起來, 沒有問題
接下來就要考慮如何將這一系列的動作用 Ansible 串起來了 :)

考量點有
  • 安裝容器服務以及啟動
  • 要有一個獨立磁碟將 container 的設定與資料存起來
    • 掛載起來的時候, 要進行切割分割區以及建立 file system
    • 掛載到指定目錄
  • 下載 gitlab-ce 的 container image 並執行他, 開通 port 80 and port 443
  • 以上的方式要以非互動的方式來進行

寫了一個 playbook 來進行 gitlab 的安裝
  • 使用 gitlab 群組來進行安裝
    • 因為想配合 Azure Dynamic Inventory 方式

檔案 gitlab_install.yml 內容如下

---
# edit by sakana 2019/5/12
#########################################################  
#
#
#########################################################  

- name: Install docker and run service
# use group
 hosts: gitlab
#  sudo: True
 become: True
 vars_prompt:
   - name: "hostname"
     prompt: "Enter gitlab hostname, ex: gitlab.example.com"
     private: no
     default: gitlab.example.com

   - name: "container_name"
     prompt: "Enter container name when we create, ex: gitlab"
     private: no
     default: gitlab

 tasks:
#    - name: test setup moudule
#      setup: filter=ansible_distribution

   - name: Install docker with openSUSE Leap
     zypper:
       name:
         - docker
         - curl
     when: ansible_distribution == "openSUSE Leap"

# 舊的方式 with_item 即將被棄用
#    - name: Install docker with openSUSE Leap
#      zypper: name={{ item }}
#      with_items:
#        - docker
#        - curl
#      when: ansible_distribution == "openSUSE Leap"

#######################################################
# 等到 openSUSE 測試完成再來測試 CentOS and Ubuntu
#
#    - name: Install docker with CentOS
#      yum: name={{ item }}
#      with_items:
#        - docker
#        - curl
#      when: ansible_distribution == "CentOS"

#    - name: Install docker with Ubuntu
#      apt: name={{ item }} update_cache=yes
#      with_items:
#        - docker.io
#        - curl
#      when: ansible_distribution == "Ubuntu"

  
#    - name: Create docker link with Ubuntu
#      shell: ln -sf /usr/bin/docker.io /usr/local/bin/docker
#      when: ansible_distribution == "Ubuntu"
#
######################################################


#-------------------------------------------------------  

   - name: Set docker enable and run
     service: name=docker state=started enabled=yes

#-------------------------------------------------------  

# 使用 parted 建立label
   - name: use parted to make label
     shell: parted /dev/sdc mklabel msdos
# 使用 parted 建立分割區, 要使用百分比的方式才能非互動
   - name: use parted create partition
     shell: parted /dev/sdc mkpart primary 0% 100%
# 建立 file system
   - name: use mkfs.xfs create file system
     shell: mkfs.xfs -f /dev/sdc1
# 使用 mount module 掛載, 寫入 /etc/fstab
   - name: mount /dev/sdc1 to /gitlab
     mount:
       path: /gitlab
       src: /dev/sdc1
       fstype: xfs
       state: mounted

#-------------------------------------------------------  

   - name: use docker command to run
     shell: docker run -d --hostname {{ hostname }} -p 443:443 -p 80:80 --name {{ container_name }} --restart always gitlab/gitlab-ce:latest

#-------------------------------------------------------  


建立方式
如果有使用 azure_rm.py 記得 chmod a+x azure_rm.py

我是使用 Azure Dynamic Inventory 方式

> ansible-playbook -i  azure_rm.py  --ask-pass  --ask-become-pass  -u  使用者名稱   gitlab_install.yml

  • 這個 playbook 目前沒有處理 security group, 暫時先用手動開, 後面視需求看要不要加進去

VM 所加掛的資料磁碟, 非互動方式的處理我是使用 parted 指令

==== parted 一些指令小記 ====

列出 /dev/sdc 上面的分割區
> parted  /dev/sdc  print

建立 label
超過 2TB 以上的
> parted  /dev/sdc mklabel  gpt

一般用
> parted  /dev/sdc mklabel msdos

建立分割區, 使用整顆硬碟
> parted  /dev/sdc  mkpart  primary 0%  100%

刪除第一個分割區
> parted  /dev/sdc rm  1

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

建立完機器, 最後的步驟就是
  • 在 Azure portal 上面開啟機器 security group 的 port 80


設定 GitLab root 密碼  -- > Change your password

就有一個 GitLab 實驗環境可以使用啦 :)

~ enjoy it

Reference:

the avatar of Chun-Hung sakana Huang

使用 ansible 管理 Azure Kubernetes Service (AKS) instance 小記

使用 ansible 管理 Azure Kubernetes Service (AKS) instance  小記

OS: openSUSE Leap 15
ansible: 2.7.10

之前的 Azure AKS instance 都是使用 az aks create 指令建立的

但是久了有的時候真的會一時忘記 az aks 指令要下哪些 …..
所以今天就參考官方網站用 ansible 寫了 playbook 來建立以及移除 AKS instance

建立 AKS instance:

我的 playbook 如下, 檔案名稱 azure_create_aks_instance.yml

---
# Azure AKS 相關測試
# edit by sakana 2019/5/9
- name: use when conditionals and setup module
 hosts: localhost
 connection: local
#
 vars_prompt:
   - name: "client_id"
     prompt: "Enter client_id"
     private: no

   - name: "client_secret"
     prompt: "Enter client_secret"
     private: no

   - name: "resource_group"
     prompt: "Enter resource group name"
     private: no
     default: sakanaK8s

   - name: "aks_instance_name"
     prompt: "Enter aks instance name"
     private: no
     default: test01

   - name: "aks_location"
     prompt: "Enter aks location"
     private: no
     default: eastus

   - name: "dns_prefix"
     prompt: "Enter aks dns_prefix"
     private: no
     default: sakanamax

   - name: "admin_username"
     prompt: "Enter admin user's name"
     private: no
     default: sakana

   - name: "aks_ssh_key"
     prompt: "Enter aks ssh public key"
     private: no

   - name: "aks_pool_name"
     prompt: "Enter aks pool name"
     private: no
     default: testsakana

   - name: "aks_count"
     prompt: "Enter how many node do you want to create?"
     private: no
     default: 1

   - name: "vm_size"
     prompt: "Enter vm size for each node"
     private: no
     default: Standard_B2s

 tasks:
  - name: Create AKS instance
    azure_rm_aks:
      name: "{{ aks_instance_name }}"
      resource_group: "{{ resource_group }}"
      dns_prefix: "{{ dns_prefix }}"
      linux_profile:
        admin_username: "{{ admin_username }}"
        ssh_key: "{{ aks_ssh_key }}"
      service_principal:
        client_id:     "{{ client_id }}"
        client_secret: "{{ client_secret }}"
      agent_pool_profiles:
        - name: "{{ aks_pool_name }}"
          count: "{{ aks_count }}"
          vm_size: "{{ vm_size }}"

建立方式

使用 ansible-playbook 指令建立

> ansible-playbook  azure_create_aks_instance.yml

依照詢問輸入相關資料就可以方便建立

建立完成之後我還是用 az ask 指令取得認證資訊 ( 從 web console 複製 )
> az  aks  get-credentials --resource-group  sakanaK8s --name  test01


接下來實驗

移除 AKS instance:
我的 playbook 如下, 檔案名稱 azure_remove_aks_instance.yml

---
# Azure AKS 相關測試
# edit by sakana 2019/5/9
- name: use when conditionals and setup module
 hosts: localhost
 connection: local
#
 vars_prompt:
   - name: "aks_instance_name"
     prompt: "Enter aks instance name you want to REMOVE"
     private: no
     default: test01

   - name: "resource_group"
     prompt: "Enter resource group name"
     private: no
     default: sakanaK8s

 tasks:
  - name: Remove AKS instance
    azure_rm_aks:
      name: "{{ aks_instance_name }}"
      resource_group: "{{ resource_group }}"
      state: absent


移除的時候一樣用 ansible-playbook 指令
> ansible-playbook  azure_remove_aks_instance.yml


這樣以後建立 AKS instance 就相對方便了

~ enjoy it
:)

Reference:

the avatar of Michal Čihař

Weblate blog moved

I've been publishing updates about Weblate on my blog for past seven years. Now the project has grown up enough to deserve own space to publish posts. Please update your bookmarks and RSS readers to new location directly on Weblate website.

The Weblate website will receive another updates in upcoming weeks, I'm really looking forward to these.

New address for Weblate blog is https://weblate.org/news/.

New address for the RSS feed is https://weblate.org/feed/.

Filed under: Debian English SUSE Weblate

the avatar of FreeAptitude
the avatar of Santiago Zarate

Table to json with jq and awk

The problem

Say you have a table that looks like this:

AGGREGATE_NEEDED    1
ARCH    x86_64
BASE_TEST_ISSUES    NUMBER
BUILD   :NUMBER:PACKAGE
DISTRI  DISTRIBUTION
FLAVOR  Server-DVD-Incidents-Install
INCIDENT_ID 99999

It’s just that it contains about 78 or more entries. Of course for a very skilled engineer or a person with a lot of tricks under the hood, this might be a very trivial task in vim or something like this, I guess that with a couple of replaces here and there, you’d get somewhere; but I’m not skilled, other than at eating.

The Solution

So I took my Key Value table saved it to a file and after googling a bit, now I’m more versed into awk :D:

    cat FILE.txt | \ 
    awk 'BEGIN { print "{" } \ 
        { printf "\"%s\":\"%s\",", $1,$2} \ 
        END { print "\"MANUALLY_GENERATED_ISO_POST\":1 }" }'
        | jq > x86_64-ready.json'"}'

I guess this could have been done easier and prettier, but fits my need and might save you too at some point. Just make sure you have jq installed ok?

a silhouette of a person's head and shoulders, used as a default avatar

EasyTAG: Organize your music with openSUSE

Audio files in formats such as MP3, AAC, and Ogg Vorbis have made music ubiquitous and portable. With the explosive growth of storage capacity, you can store huge libraries of music. But how do you keep all that music organized? Just tag your music. Then you can access it easily locally and in the cloud. EasyTAG is a great choice for tagging music and is available in openSUSE.

Many audio file types support tagging, including:

  • MP4, MP3, MP3, MP2
  • Ogg Speex, Ogg Vorbis, Ogg Opus
  • FLAC
  • MusePack
  • Monkey Audio

Installing EasyTAG

EasyTAG is easy to install from openSUSE repositories:

Or use Zypper in a terminal as Root:

# zypper install easytag

Then launch the program from the Software tool or the application menu for your desktop. EasyTAG’s straightforward interface works well in most desktop environments.

Tagging music

Select a folder where you have music you want to tag. By default, EasyTAG will also load subfolders. You can select each file and add tag information such as the artist, title, year, and so on. You can also add images to a file in JPG or PNG format, which most players understand.

Files you have altered appear in bold in the file listing. To save each, press Ctrl+S. You can also select the entire list and use Ctrl+Shift+S to save all the files at once.

One of the most powerful features of EasyTAG is the file scanner. The scanner recognizes patterns based on a template you provide. Once you provide the right template and scan files, EasyTAG automatically tags all of them for you. Then you can save them in bulk. This saves a lot of time and frustration when dealing with large libraries.

When you upload your tagged files to a cloud service, your tags allow you to quickly find and play the music you want anytime.

This article is an adaption of EasyTAG: Organize your music on Fedora under Creative Commons License.

a silhouette of a person's head and shoulders, used as a default avatar

EasyTAG: Organisiere deine Musik unter openSUSE

Audiodateien in Formaten wie MP3, AAC und Ogg Vorbis haben Musik allgegenwärtig und tragbar gemacht. Mit dem explosionsartigen Wachstum der Speicherkapazität kannst du riesige Musikbibliotheken speichern. Aber wie hältst du all diese Musik organisiert? Tagge einfach deine Musik. Dann kannst du einfach lokal und in der Cloud darauf zugreifen. EasyTAG ist eine gute Wahl für die Kennzeichnung von Musik und ist unter openSUSE verfügbar.

Viele Audiodateitypen unterstützen das Tagging, einschließlich:

  • MP4, MP3, MP3, MP2
  • Ogg Speex, Ogg Vorbis, Ogg Opus
  • FLAC
  • MusePack
  • Monkey Audio

Installation von EasyTAG

EasyTAG ist einfach aus openSUSE-Repositories zu installieren:

Oder benutze Zypper in einem Terminal als Root:

# zypper install easytag

Dann startest du das Programm über das Anwendungsmenü auf deinem Desktop. Die unkomplizierte Benutzeroberfläche von EasyTAG eignet sich für die meisten Desktop-Umgebungen.

Musik taggen

Wähle einen Ordner aus, in dem du Musik hast, die du markieren möchtest. Standardmäßig lädt EasyTAG auch Unterordner. Du kannst jede Datei auswählen und Tag-Informationen wie Künstler, Titel, Jahr usw. hinzufügen. Du kannst auch Bilder im JPG- oder PNG-Format zu einer Datei hinzufügen, was die meisten Player auch verstehen.

Von dir geänderte Dateien werden in der Dateiliste fett gedruckt. Um alle zu speichern, drückst du Strg+S. Du kannst auch die gesamte Liste auswählen und mit Strg+Shift+S alle Dateien auf einmal speichern.

Eine der leistungsfähigsten Funktionen von EasyTAG ist der Dateiscanner. Der Scanner erkennt Muster auf der Grundlage einer von dir bereitgestellten Vorlage. Sobald du die richtigen Vorlagen und Scan-Dateien zur Verfügung gestellt hast, markiert EasyTAG automatisch alle für dich. Dann kannst du sie in großen Mengen speichern. Das spart viel Zeit und Frustration im Umgang mit großen Bibliotheken.

Wenn du deine getaggten Dateien zu einem Cloud-Service hochlädst, ermöglichen dir deine Tags, die gewünschte Musik jederzeit schnell zu finden und abzuspielen.

Dieser Artikel ist eine Adaption & Übersetzung von EasyTAG: Organize your music on Fedora unter der Creative Commons Lizenz.

the avatar of Chun-Hung sakana Huang

使用容器化方式, 建立Ansible 與三大雲端平台工具 azure-cli , awscli 與 gcloud with openSUSE Leap 小記

使用容器化方式, 建立Ansible 與三大雲端平台工具 azure-cli , awscli 與 gcloud with openSUSE Leap 小記

OS: openSUSE Leap 15

上次整理了 ansible 與 azure-cli with openSUSE Leap 15 in container.
因為後面又有開始實驗 awscli 以及 gcloud (Google Cloud SDK) 工具

就想要把這三個雲端平台的工具整進容器內.

接下來整理三個雲端平台工具設定檔相關位置與資訊

Microsoft Azure:

Amazon AWS:

Google Cloud Platform

已經製作好 container image 在 docker hub 上

使用方式 ( 須先具備容器環境, 例如 docker 或是 podman, 以下範例使用 docker )

如果之前完全沒有使用過三大平台工具, 只是想要快速有 ansible 與相關工具( azure-cli, awscli, gcloud )
>  docker  run  -it  sakana/ansible_opensuse15   /bin/bash
  • 進到容器之後就可以開始使用, 接下來就是進行各平台的登入驗證, 將取得相關驗證並開始作業

如果已經有在平台進行驗證, 可以在 docker  run 的時候配合 -v 的選項, 將本機的設定檔掛載

> docker  run  -v  ~/.aws:/root/.aws  -v  ~/.azure:/root/.azure  -v  ~/.config/gcloud:/root/.config/gcloud  -it  sakana/ansible_opensuse15:2019050402  /bin/bash
  • 各個設定檔請參考上面的資訊
  • 我個人是還有 -v 掛載 playbook 目錄 :)

這樣以後使用各個平台的工具就方便多了 :)

~ enjoy it

Reference:

the avatar of Martin de Boer

Leap 15.1, the release that nobody talks about

openSUSE Leap 15.1 is almost ready for release! (1) This is always a high point of the year for me. I started researching what was new in this release. However, there is not much buzz around this release. I found only a few articles on Softpedia (2), Phoronix (3) and the announcement by Ludwig Nussel (4).

When I tried to establish what was new (5) in Leap 15.1, I started to understand why. Leap 15.1 mostly features minor updates. Still there are updates that are noteworthy. In the table below I highlighted in green the updated packages that are really new. In blue, I highlighted new packages that are also present in updated Leap 15 installations.

Package name Leap 15 Leap 15 Leap 15.1 Tumbleweed
with updates
Amarok 2.9.0 2.9.0 2.9.0 2.9.0
Audacity 2.2.2 2.2.2 2.2.2 2.3.1
Calibre 3.23.0 3.27.1 3.40.1 3.40.1
Calligra suite 3.1.0 3.1.0 3.1.0 3.1.0
Chromium browser 66 73 73 73
Darktable 2.4.3 2.4.3 2.6.2 2.6.2
Digikam 5.9.0 5.9.0 6.0.0 6.1.0
Flatpack 0.10.4 0.10.4 1.2.3 1.2.4
GIMP 2.8.22 2.8.22 2.8.22 2.6.12
Gnome Applications 3.26 3.26 3.26 3.30
GNU Cash 3.0 3.0 3.0 3.4
Hugin 2018.0.0 2018.0.0 2018.0.0 2018.0.0
Inkscape 0.92.2 0.92.2 0.92.2 0.92.4
KDE Applications 17.12 17.12.3 18.12.3 19.04.0
KDE Plasma 5 desktop 5.12.5 5.12.8 5.12.8 5.15.4
Krita 4.0.3 4.0.3 4.1.8 4.1.8
LibreOffice 6.0.4 6.1.3 6.1.3 6.2.3
Linux kernel 4.12.14 4.12.14 4.12.14* 5.0.9
Mozilla Firefox 60.0 60.6.1 60.6.1 66.0.3
Mozilla Thunderbird 52.7 60.6.1 60.6.1 60.6.1
Pidgin 2.13 2.13 2.13 2.13
Rapid Photo Downloader 0.9.9 0.9.9 0.9.14 0.9.14
Scribus 1.4.7 1.4.7 1.4.7 1.4.7
Shotwell 0.28.3 0.28.3 0.28.3 0.30.2
VLC 3.0.2 3.0.2 3.0.6 3.0.6
YaST 4.0.74 4.0.87 4.1.68 4.2.0

Software package updates

Calibre is updated to 3.40 and includes some improvements to Kobo drivers, support for the Kindle Whitepaper 2018, a bunch of improvement for the Edit book functionality, the Content station has a new “Copy to library” function and some usability improvements of the Tag browser.

Darktable is updated to 2.6, including a new retouch module, a new filmic module, a new module to handle duplicates in the darkroom, you can now change the cropped area in the perspective correction module, the mask blur feature has been extended with a guided-filter to fine tune it and the color balance module has two new modes based on ProPhotoRGB and HSL.

Digikam is updated to 6.0. This means that you can now manage video files in the same way as you would manage photos. In the album management, you can now use virtual folders (RAW/JPG/PNG) to sort items in a list. Digikam 6.0 uses libraw 0.19, which enables support for over 200 new RAW files. This includes support for iPhone 8, 8+ and X and support for Samsung S7, S7 Edge and S8. There are also many improvements for connecting with external web services. Finally, Digikam now uses a separate database for fussy and duplicate search, improving performance and reliability.

Flatpack is updated to 1.2.3, which includes many security improvements.

KDE applications got a big update to 18.12. Dolphin (file manager) received many improvements, including the ability to hide the Places panel and dock the Terminal panel. The folder view and settings dialog have been updated. Ocular (PDF and document viewer) has a new typewriter annotation feature that enables you to type everywhere on a page. Konsole (terminal application) now has full support for emoji. The Gwenview (image viewer) has seen many improvements, including the crop tool, the reduce red eye tool, improved zooming and better drag and drop functionality. Spectacle (screenshot tool) gained the ability to sequentially number screenshot files and now remembers the lastest save settings. With the rectangular region selection mode, you can select a part of the screen . Ark (unzip tool) now supports the tar.zst archive file standard.

Krita is updated to 4.1.8 and introduces the new reference images tool that lets you place and edit a reference image to help you with drawing. Another help with drawing is provided by the improved vanishing point assistant. Krita 4.1 features many animation improvements and a better color picker tool.

LibreOffice 6.1 offers 2 new icon themes ‘Colibre’ and ‘Karasa Jaga’, it loads documents with many images faster, the gradient tool has been improved and new fill gradients are available, you can now add page numbers and page counts in the header and footer sections of Writer, you can insert a Signature line in Writer, you can now sort images anchored to cells in Calc, the merge cells dialog box has become much clearer in Calc, you can now use CSVs as data sources in Calc and a new page menu has been added in Impress.

Linux kernel has received some back-ports of Graphics hardware from the Linux kernel 4.19, including better support for AMD Vega cards.

Rapid Photo Downloader (from the Graphics repository) is updated to 0.9.14. Canon’s latest RAW file format CR3 is supported on systems that have ExifTool 10.87 or newer.

YaST has received several improvements and is updated to 4.1.68. YaST has improved the default partitioning proposal for systems with less than 12 GB, YaST received some UI improvements including better support for 4K monitors, the YaST Firewall module has been adapted to work with Firewalld, the Partitioner can now directly format full disks and create MD RAIDs on top of disks without partitions.

Installation options

Besides the standard installation options (full ISO, KDE live ISO, Gnome live ISO, network installer) there is now full support for Raspberry Pi installations. The server installation now features an option for a transactionally updated system. Furthermore there are the more traditional server installations for X86_64 and JeOS (the minimal server installation for the Cloud). You can find the Beta versions of Leap 15.1 here.

Published on: 4 May 2019