Author: truongan

  • Problem with my HP LaserJet 1020

    As per stated in the archlinux wiki:

    Some HP printers (e.g HP LaserJet) require their firmware to be downloaded from the computer every time the printer is switched on. If there is an issue with udev (or equivalent) and the firmware download rule is never fired, you may experience this issue. As a workaround, you can manually download the firmware to the printer. Ensure the printer is plugged in and switched on, then enter

    hp-firmware -n
    
  • Install commafeed on your server

    This was easier than I thought. Commafeed is a Google Reader inspired self-hosted RSS reader, based on JAX-RS, Wicket and AngularJS. It was very nice feed reader, fast, sleek look and more over can be run on your own server. The read me on https://github.com/Athou/commafeed pretty much say it all.

    First you need maven build. If you are using gentoo (like me) a simple

    maven-bin

    will do.

    Then you download commafeed from githup:

    git clone https://github.com/Athou/commafeed.git 
    cd commafeed

    Now you build it, it support many database backend, refer to the read me for more details. If you use mysql or mariadb (like me) then build it with this command:

    mvn clean package tomee:build -Pprod -Pmysql

    My first time build wsa slow as hell because maven had to download some additional library or something. But it will be much faster when you update commafeed. When building finished, you can install commafeed anywhere you want. Simply unzip the file

    target/commafeed.zip

    in the source code directory to the installation destination. eg:

    mkdir /opt/commafeed/
    cd /opt/commafeed/
    unzip ~/commafeed/target/commafeed.zip

    Some final configuration in the installation directory is required before launching:

    mkdir logs
    vim conf/tomee.xml

    This will create logs directory and open up the database connection file. Edit it to your taste and save. Then you can launch:

    ./bin/startup.sh

    You will now see commafeed running at localhost:8082/commafeed

  • Change window button layout and window decoraation theme in Gnome 3:

    Got the answer from https://ask.fedoraproject.org/question/7482/fedora-17-using-gnome-3-how-to-enable-the-maximize-minimize-of-window-border/

    I know 2 methods:
    Using gnome-tweak-tool (Shell >> Arrangement of buttons on the titlebar)
    Using dconf

    Here are some dconf examples

    Only the close button on the left side (i prefer this)
    dconf write /org/gnome/shell/overrides/button-layout '"close:"'

    Minimize, maximize, close on the right side
    dconf write /org/gnome/shell/overrides/button-layout '":minimize,maximize,close"

    Change theme: answer from http://community.linuxmint.com/tutorial/view/1148

    run: "dconf-editor", navigate to org > gnome > desktop > wm > preferences and change the "theme" value from "Adwaita" to any other installed theme you want. Remember this because in the same place you can also change the window button layout, among others.

  • Nâng cấp máy bàn.

    Dạo này mình ít viết blog. Mà thật ra là gần như chẳng có viết gì cả. Chung quy cũng tại vì… lười. Chuyện xây ra xung quanh thì nhiều, buồn vui sướng khổ đủ cả, nhưng mà sao lười viết kinh khủng, gần như viết lách cái gì cũng lười, viết báo cáo cũng lười nốt. 🙁

    Thôi thì cũng ráng phết đại vài chữ vào blog để sau này có gì còn lục lại. Hôm cuối tháng 6 vừa rồi mình nâng cấp cái case, thay case cũ bằng case mới, In Win G7 tốn hết 1 triệu mốt. Case này nguồn gắn ở dưới, thế là cáp nguồn 4pin cho CPU kéo không lên tới nơi, thế là mất toi nó thêm 40k nữa để mua dây chuyển. Cơ mà lúc ráp xong mọi thứ rồi mới phát hiện thiếu dây nguồn, cảm giác thật là khó đỡ, vừa buồn cười mà vừa buồn bực, giống như chơi game thua một vố đau vậy. Phải mất thời gian đi mua cáp chuyển và tốn thêm ít bạc.

    Được cái là case mới cũng ngon, nút nguồn để trên đỉnh, có usb 3.0 ở mặt trước, có HDD dock, cái đền HDD led của case cũ bị hư thì case này đã thấy nó chạy bình thường, có fan speed controller để vặn cho quạt chạy chậm lại, không phải lúc nào cũng chạy vù vù như case cũ. Thôi thì cũng tốt.

    Case mới: http://tandoanh.vn/san-pham/2852/in-win-g7-black-windowed-mid-tower-case.html

  • Vô đề

    Không biết đặt tiêu đề gì. Lúc ông Ngoại mất, tin đột ngột như sét đánh ngang tại, cảm xúc vỡ òa trong đáy lòng. Bây giờ ông Nội bị té, xuất huyết não, tình trạng xấu đi từ từ, tin tức dội về từ từ, không biết phải nói gì cả. Rối bời, ngổn ngang, chằng chịt, u ám, chẳng biết phải làm gì, chẳng biết làm được gì, chẳng biết phải nói gì… nặng trĩu.

  • Restarting GNOME Shell using Terminal, or How to use SIGHUP

    Nice information so I shamelesslly copy it over to my blog for later reference

    Restarting GNOME Shell using Terminal, or How to use SIGHUP

    Recently I’ve been using my laptop for some heavy processing and as a result of that GNOME Shell started to freeze every now and then.
    Normally when something goes wrong I try “alt+f2” and then “r” which is a shortcut to restart the GNOME Shell, but when it freezes you can only use your mouse … and go to other terminals!

    I’m talking about TTYs, one of the most wonderful features of Unix based operating systems, IMO. It is simply fascinating that you can use one set of mouse/keyboard/monitor to login with more than one user at the same time.

    Back to the GNOME Shell problem. The solution is simple: send a signal to whatever process that is causing the problem. If it’s flash player or a game just kill it with SIGKILL or pause it with SIGSTOP, but as far as I know, many Linux services recognize the SIGHUP (signal code=1), including GNOME Shell. You can use `kill` or `killall` command to send this signal to programs like this:# kill -s SIGHUP [pid]
    # killall -s SIGHUP [process name]

    Here is the description of the signal according to the manual page of signal in section 7:
    Signal Value Action Comment
    ──────────────────────────────────────────────────────────────────────
    SIGHUP 1 Term Hangup detected on controlling terminal
    or death of controlling process

    Basically this signal is just poking the process and giving the information with no predefined action (whereas SIGKILL kills the program no matter what), so it’s up to the programmer to define a procedure to be executed in case of receiving that signal.

    Fortunately for me, GNOME developers have been kind enough to implement such a procedure that just reboots GNOME Shell without closing child processes (which include all graphical programs!), just as “alt+f2″ “r” does.

    That’s it, just don’t kill Linux services, poke them with SIGHUP!

    This entry was written by mahrud, posted on December 22, 2012 at 6:09 AM, filed under Linux and tagged freeze, gnome-shell, reboot, SIGHUP, tty. Bookmark the permalink. Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL.

    http://algorithms.ir/~mahrud/blog/2012/12/restarting-gnome-shell-terminal-or-sighup/

  • Phím tắt (shortcut keys) để expand/open/close/collapse/folds thread trong evolution. Và một số phím tắt khác

    Theo đây (https://mail.gnome.org/archives/evolution-list/2008-November/msg00098.html) thì:

    Hi,
    when staying in a tree, press Shift+Left/Shift+Right, I think it's a
    standard shortcut for such action in Gtk+, but I'm not sure.
    Hope that helps,
    Milan

    Thank you Milan

    Ctrl + H để select nguyên thread và Ctrl + K để mark nguyên đống đó as read.

  • Joomla note: Remove the “powered by” in footer, disable registration

    First:
    http://www.cmsmind.com/how-to-remove-the-footer-in-joomla-2-5/

      Overview of how you will Change or Remove your Joomla 2.5 Footer:

    • Find the Template Manager – Customize Template in Template Manager
    • Edit the Template Master File in Template Manager
    • Remove/Change Joomla 2.5 footer code in Template Manager
    1. Find the Template Manager – Customize Template
      Login to your Joomla 2.5 Administrator backend
      Click on Extensions, Template Manager
      Switch to the ‘Templates’ tab
    2. Edit the Template Master File in Template Manager

      In the Templates Manager: Templates
      Scroll down and click on ‘<template_name> Details and Files’
      Under Template Master Files, Click on ‘Edit main Page templates’

    3. Trong cái file code, tìm

    Cách khóa đăng ký tài khoản xem được từ trang này http://www.inmotionhosting.com/support/edu/joomla-25/users/disable-user-registration

    • Log into your Joomla Dashboard
    • Click the User Manager icon click-user-manager
    • Click the Options icon in the top right click-options Under the omponent tab, set Allow User Registration to No and then click Save & Close set-allow-user-registration-to-no

    You have now disabled user registration! Your Joomla 2.5 website will no longer have the new user registration option.