Damn man, I really expected that after install dnf install autojump-zsh, everything should run without any modification, I can start using j
command. But no, command j not found. This post is all about installing autojump on Fedora.
Each user has their favorite shell, I am using zsh. this guide is all about setup autojump on zsh. The methodology is the same for fish or bash.
Hi, I am running Firefox on Fedora 41, my display manager is wayland by default. While using Firefox, sometime, I
can’t do mouse click on Firefox. This post will help you save 5 minutes.
First of all, the key point here is environment variable MOZ_ENABLE_WAYLAND=1. We need it before running firefox.
You can test by running this command. If it works, you can read futher, else, stop wasting your time reading my post.
$ export MOZ_ENABLE_WAYLAND=1
$ firefox
I assume that you have play with your firefox smoothly. Now, we will edit .desktop file. So what is it?
it’s a application shortcut for GNOME. You can find it /usr/share/applications.
Now, edit /usr/share/applications/org.mozilla.firefox.desktop, add env MOZ_ENABLE_WAYLAND=1 on Exec= line.
Remember that there are many places need to update.
As a consequence, I have to use CloudFlare WARP to dogde it. It’s fine till I have trouble pushing/cloning my source code to github. I am pretty sure that CloudFlare did
something as a middle man!
$ ssh -T git@github.com
# ssh: connect to host github.com port 22: Connection timed out
So, there are two choices:
[1] Turn off cloudflare’s warp client
[2] Change github ssh port from 22 to 443
This post is all about the second solution. Do ssh to ssh.github.com port 443 instead of github.com port 22.
If you run ssh -T -p 443 git@ssh.github.com and it works, you can continue reading this post. Else, this post is not for you cause ssh.github.com port 443 is also BLOCKED.
$ ssh -T-p 443 git@ssh.github.com
# Hi nguyenvinhlinh! You've successfully authenticated, but GitHub does not provide shell access.
If you see that message Hi nguyenvinhlinh! You've successfully authenticated, but GitHub does not provide shell access. You can alias ssh’s config and work around ssh's port 22, connection timeout error.
I will make it short! Edit file ~/.ssh/config with the following config.
Hostgithub.comHostnamessh.github.comPort443
And test it with: ssh -T git@github.com. You should see output like:
Hi nguyenvinhlinh! You've successfully authenticated, but GitHub does not provide shell access.
This post will guide you integrate Nexus Dashboard to Phoenix Web Framework. First of all, you should buy and use Nexus Dashboard instead of craking it!
I will assume that you did download and unzip the web dashboard template, The latest version is 2.2.0.
Step 1: Go to nexus directory, find css assets.
My nexus version is 2.2.0, after unzip, you will need to go to nexus-html@2.2.0/src/styles/.
All css assets here! The whole point now is to replace phoenix app.css to nexus app.css.
As you can see, they use import another css in relative paths. When we integrate it with phoenix, we need to take care those paths.
Step 2: Copy nexus css assets to phoenix web app
In phoenix web app, open directory /assets/css/ and create a new sub-directory named nexus_dashboard.
In this assets/css/nexus_dashboard, copy nexus css into this, except app.css.
This is a directory tree after copy for assets/css/nexus_dashboard
Now, come back the app.css, I don’t want a conflict with the existing one app.css, so I named a new main css file as nexus_app.css. In addition, due to different relative paths, I must update these with ./nexus_dashboard.
You gonna see a lot of missing javascrip library from now on, but I will show you how to solve it. At first, run mix tailwind _project_name.
100% you gonna see missing daisyui.js and daisyui-theme.js in assets/css/nexus_dashboard/daisyui.css. To solve it, you need to use relative path to assets/vendor/daisyui.js and assets/vendor/daisyui-theme.js. I would like to keep these file as is. When you create phoenix 1.8 project, daisyui.js and daisyui-theme.js is already there!.
In addition, you gonna see a mission iconify/tailwind4 library. At this point, there is no choice but using npm ecosystem. In assets, run npm install @iconify-json/lucide and @iconify/tailwind4.
This is content for assets/package.json. I really want to depend as less as possible the npm ecosystem, but have no choice.
A minor note for you, cause you need lucide-icon and rely on npm install to collect @iconify, lucide and tailwind4 for lucide-icon. it’s a good idea that you can ignore prebuild vendor/daisyui.js and daisyui-theme.js,
just use npm install these two libraries. Remember to update your nexus_dashboard/daisyui.css’s relative paths.
Step 2: Extract the zip file, and find a file named metadata.json
This is file content of metadata.json.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{"_generated":"Generated by SweetTooth, do not edit","description":"Adds AppIndicator, KStatusNotifierItem and legacy Tray icons support to the Shell","gettext-domain":"AppIndicatorExtension","name":"AppIndicator and KStatusNotifierItem Support","settings-schema":"org.gnome.shell.extensions.appindicator","shell-version":["45","46","47"],"url":"https://github.com/ubuntu/gnome-shell-extension-appindicator","uuid":"appindicatorsupport@rgcjonas.gmail.com","version":59}
Look at line 13, looking for the uuid, it’s appindicatorsupport@rgcjonas.gmail.com.
Step 3: Rename the extracted directory to the uuid that is copied in Step 2.
It’s appindicatorsupport@rgcjonas.gmail.com
Step 4: Copy the renamed directory in Step-3 to ~/.local/share/gnome-shell/extensions.
How to test?
You can go to terminal and type gnome-extensions list.
$ gnome-extensions list
appindicatorsupport@rgcjonas.gmail.com
apps-menu@gnome-shell-extensions.gcampax.github.com
background-logo@fedorahosted.org
launch-new-instance@gnome-shell-extensions.gcampax.github.com
places-menu@gnome-shell-extensions.gcampax.github.com
window-list@gnome-shell-extensions.gcampax.github.com
On the other hand, you can open gnome extensions - https://apps.gnome.org/Extensions/. Your new extension should be there in Manually installed list.
Thay đổi mining_rig_monitor_web.ex , phần live_view/0:
use Phoenix.LiveView, layout: {MiningRigMonitorWeb.Layouts, :app} -> use Phoenix.LiveView
Sau cùng, nó sẽ trông như thế này.
# Phiên bản cũdeflive_viewdoquotedousePhoenix.LiveView,layout:{MiningRigMonitorWeb.Layouts,:app}unquote(html_helpers())endend# Phiên bản mớideflive_viewdoquotedousePhoenix.LiveViewunquote(html_helpers())endend
Tôi đã nghĩ rằng sẽ phải có lỗi xảy ra ở lần chạy iex -S mix phx.server đầu tiên, tôi sẽ cần phải thay đổi các live_view liên quan, nhưng mà không, khả năng tương thích ngược là khá tốt.
Tôi trích dẫn một cái quan trọng liên quan đến root.html.heex và app.html.heex (version 1.7) , app/1 (version 1.8).
defmoduleDevAppWeb.Layoutsdo@moduledoc"""
This module holds different layouts used by your application.
See the `layouts` directory for all templates available.
The "root" layout is a skeleton rendered as part of the
application router. The "app" layout is rendered as component
in regular views and live views.
"""end
cái app/1 này phải được gọi thì nó mới render, không có chuyện chạy mặc định. Có thể ở 1.7 có file app.html.heex, tuy nhiên, nó ko liên quan đến func app/1
Tôi cần kiểm tra chéo 1 chút, thực sự là app.html.heex có được chạy mặc định hay không, sau khi tôi đã bỏ option layout: {MiningRigMonitorWeb.Layouts, :app}
Để test, tôi đã thêm 1 cái tag <h1> cho file app.html.heex để đánh dấu.
Đệt, nó ko chạy qua app.html.heex sau khi bỏ option layout: {MiningRigMonitorWeb.Layouts, :app} trong _web.ex, live_view/0 nhé.
Điều này nghĩa là tôi sẽ phải:
Kéo nội dung của app.html.heex vào module Layouts, function app
Thêm alias MiningRigMonitorWeb.Layouts trong mining_rig_monitor_web.ex, function html_heler/0
Các liveview module, ví dụ module MiningRigMonitorWeb.AsicMinerLive.Index, sau khi tôi tách function render/1 thành file index.html.heex. nếu tôi mà muốn sử dụng liveview layout có tên là app,
tôi sẽ cần phải bọc nó lại với tag <Layout.app> </Layout.app>
Tiếp theo là về cái vụ Scope. Tôi tính toán là sẽ mix phx.gen.auth ở một dự án test khác, sau đó sẽ copy quá.
Tuy nhiên, bị vướng field :authenticated_at, :utc_datetime trong Accounts.UserToken, ở phiên bản 1.7, không có field authenticated_at.
Tôi có xem kỹ hơn cái field này, có vẻ là nó liên quan đến sudo mode. Thế tính năng sudo mode là gì?
Tính năng cực kỳ thích hợp cho những tác vụ nhạy cảm. Nó sẽ yêu cầu người dùng phải đăng nhập lại trước khi đưa ra hành động nào đó.
Tôi không có nhu cầu dùng sudo mode. Cụ thể là trong dự án Mining Rig Monitor.
Thực tế, app này chỉ có 1 user role là admin. Chả có nhu cầu đụng đến Scope luôn, thôi dẹp cho khỏe.