Archive

Posts Tagged ‘Linux’

Linux, GNU and Linux

October 3rd, 2009 Fu4ny No comments

Linux often used to define GNU/Linux. When people mention about "Linux", they were talking about "GNU/Linux" most of the time.

But, Linux ( I mean the kernel ) isn't GNU. It doesn't require any GNU tools such as GCC to be built.

The problem is,  Linux itself is a GNU covered, it released under GNU/GPL, and it should be a GNU software.

So yeah~ GNU/Linux ( that often used as the distro ) is GNU, but Linux itself isn't GNU, it's GNU software. Quite complicated! heh~

Categories: Post Tags: , ,

Reconfigure Nvidia driver for the new kernel

May 10th, 2009 Fu4ny No comments

As you know, when you're upgrading your Linux Kernel and restart, your nvidia driver need to be compile for the new kernel ( This is only apply to manual installed Nvidia driver, if you installed your driver from Hardware Drivers, so you don't have to recompile it )

In this post, I'll show you how to automatically compile nvidia driver when you installed a new kernel.

Firstly, you'll need the driver, you can get it from nvidia.com, or as you manually installed nvidia drivers, it should be downloaded already. Move this file to /usr/src/ folder and rename it make a symbolic link named nvidia-driver. For example, when you have the beta driver 185.19:

sudo install NVIDIA-Linux-185.pkg.run /usr/src
sudo ln -s /usr/src/NVIDIA-Linux-185.pkg.run /usr/src/nvidia-driver

So you had the property driver, each time you upgrade your driver, remember to edit the symbolic link to the new file. And now, open your favorite editor and copy those code.

#!/bin/bash
#
 
# Set this to the exact path of the nvidia driver you plan to use
# It is recommended to use a symlink here so that this script doesn't
# have to be modified when you change driver versions.
DRIVER=/usr/src/nvidia-driver
 
# Build new driver if it doesn't exist
if [ -e /lib/modules/$1/kernel/drivers/video/nvidia.ko ] ; then
    echo "NVIDIA driver already exists for this kernel." >&2
else
    echo "Building NVIDIA driver for kernel $1" >&2
    sh $DRIVER -K -k $1 -s -n 2>1 > /dev/null
 
    if [ -e /lib/modules/$1/kernel/drivers/video/nvidia.ko ] ; then
        echo "   SUCCESS: Driver installed for kernel $1" >&2
    else
        echo "   FAILURE: See /var/log/nvidia-installer.log" >&2
    fi
fi
 
exit 0

Save it as update-nvidia and then

sudo mkdir -p /etc/kernel/postinst.d
sudo install update-nvidia /etc/kernel/postinst.d

And now, each time you upgraded a new kernel version, your nvidia driver will recompile.

But what if you've upgraded a new kernel and the driver stopped working. I know that whenever you restart your PC, the driver will not get compile ( because the kernel will not call postinst anymore ). So the solution is: Run update-nvidia manually

sudo sh update-nvidia `uname -r`

Remember that `uname -r` is required for the script.
That's all, restart your computer and enjoy with nvidia :)

Categories: Post Tags: , , ,

Get to know Linux: Fluxbox

May 8th, 2009 Fu4ny No comments

If you’ve been around Linux long enough, then you most likely will have heard about Fluxbox. Fluxbox is a desktop that was based on Blackbox 0.61.1, which makes it extremely light weight, fast, and reliable. Fluxbox is also very minimalistic which makes it ideal for certain situations. Although Fluxbox might seem somewhat lacking in the features of a standard, modern desktop, don’t sell it short. Fluxbox is easy to use and doesn’t suffer from the bloat of other desktops.

But just what does Fluxbox offer if it is so minimal? Believe it or not it offers everything you need on a desktop to get your job done. Let’s take a look at the latest version of this old-school Linux desktop.

Fluxbox Overview

Fluxbox Overview

* Mouse menu: This is the only menu you will find on the desktop.

* Slit: This is a dock for any application that is “dockable”.

* Toolbar: This bar (by default at the bottom of the screen) shows all of the windows of your desktop and contains the system tray, current workspace name, and more.

* Workspaces: Switch between different workspaces to keep your desktop organized.

* Tabs: Organize windows together into one or multiple tabbed windows to keep clutter to a minimum.

* Keyboard Shortcuts: Create your own keyboard shortcuts via simple flat text configuration.

* System Tray: This tool is used to house tiny applications that serve specific purposes (such as the Network Manager applet.)

Figure 1 shows the Fluxbox desktop. As you can see it is, in fact, very minimal yet doesn’t suffer from a loss of useability.

Configuring the menu

By default you will notice a single right click on the desktop will bring up a rather barren menu. Figure 1 shows a menu with a couple of additions: Firefox, Thunderbird, Songbird, and GIMP. Adding to this menu is simple. One of the entries in the menu is xterm, which you will need to open in order to edit the menu text file.

Once xterm is opened issue the command:

nano ~/.fluxbox/menu

to open up the menu configuration file. Each menu entry consists of a minimum of:

[exec] (NAME) {COMMAND}

Where NAME is the name of the application and COMMAND is the command to start up the application. So an entry for Firefox would look like:

[exec] (Firefox) {firefox}

You can also create submenus by starting each submenu with:

[submenu] (SUBMENU NAME)

Where SUBMENU NAME is the name of the submenu you want to use. So a Networking submenu could look like:

[submenu] (NETWORKING)

[exec] (Firefox) {firefox}

[exec] (Thunderbird) {thunderbird}

Once you have finished your menu, save it and you will automatically see the changes (no need to restart Fluxbox.)

Tabs

This is one of the

Tabs Fluxbox

Tabs Fluxbox

more unique features to Fluxbox. Tabs are similar to browser tabs in Firefox. You can join various windows together into one tabbed window in order to keep things organized. As you can see, in Figure 2, Firefox and Thunderbird have been joined together in one window. To switch back and forth between each just click the respective tab for the application you want to work with.

To join two windows together you simply middle mouse click (if you only have two buttons click them both at the same time) on the titlebar of one window and drag it to the titlebar of the window you want it to join. So to join Thunderbird with Firefox click on Thunderbird’s title bar with the middle mouse button and drag it to the Firefox titlebar. You can remove an application from a joined window by middle mouse clicking on the titlebar and dragging it out of the window.

Setting a background

One thing you will notice is that Fluxbox is bereft of any tool to help you set the background image. For many this isn’t an issue, but there are those who do prefer to have a personalized wallpaper on their desktop. In order to add a specific wallpaper you have to add a line to the ~/.fluxbox/startup file. This line will look like:

fbsetbg -f /PATH/TO/IMAGE/FILE

Where /PATH/TO/IMAGE/FILE is the explicit path to the background image you want to use.

In the case of the background, you will have to restart Fluxbox in order for the change to take effect.

Who is Fluxbox for?

I get this question a lot. Who would want to use such a minimal window manager? The first, and obvious, answer, is anyone with an older or less powerful machine. Employing Fluxbox on a machine with less power will not gobble up precious CPU or memory leaving more for applications.

I have deployed Fluxbox on kiosk and cafe machines that are used for specific purposes. Say you want to allow only the web browser to be used. For this you can alter the menu file to only include a web browser. That way the user can not run another other program (unless they how to get to a console window).

Fluxbox is also a good window manager for anyone who prefers a very minimalistic approach to computing. There is little to get in the way of your work. And since Fluxbox is so reliable, you won’t be worrying about your desktop crashing.

via Get to know Linux: Fluxbox.

Categories: Post Tags: , ,

How To: Run program in background

April 28th, 2009 Fu4ny No comments

You may know that, put "&" in the end of the command will make that command run in background. But when you logout, the terminal will be killed, and your command be killed, too.

That why we need another way: using "screen". It lets you run a new screen, do some stuff, detach, and resume your work even when you logged out.

In this 'How-to, I use SSH, if you're in a local computer, it should be the same (  hope that I'm right :P )..

  1. Login to your server
  2. In the Terminal, run "screen"
  3. Do some command you like ( you can put & in the end of each command to make it run in background )
  4. Press Ctrl + A and then Ctrl + D ( It'll detach this screen and return you to your old Terminal )
  5. Logout, and your process ( your screen ) still be running.

If you want to resume to your screen ( to do more work, kill some process, or check the process log ), just

  1. Login to your server
  2. Run "screen -r"
  3. You will be resumed to your old screen.
  4. Detach it again if you still want it running.
  5. Logout

The screen program lets you run multiple program in the same time. I never try this but you can try it yourself: Press Ctrl + A, Ctrl + C will open a new prompt, use Ctrl + A to switch between each prompt.

For more detail about screen and its command, try "man screen" ( never try this, too :P )

Categories: Post Tags: , , ,

Bộ gõ tiếng Việt và những thói quen xấu

April 19th, 2009 Fu4ny 2 comments

Nhắc đến bộ gõ tiếng Việt thì ko thể ko nhắc tới Unikey và Vietkey, cả 2 đều đã ngừng phát triển từ lâu, nhưng ko thể phủ nhận công lao của 2 bộ gõ này đối với cộng đồng.

Tuy nhiên, chuyển sang dùng Linux, với 1 bộ gõ Telex "chuẩn", ta mới thấy những thói quen xấu mà Unikey và Vietkey đã tạo ra:

  • Thói quen xấu lớn nhất, đó chính là thói quen bỏ dấu tự do, chúng ta bỏ dấu tùm lum, đáng nhẽ viết chữ "rượu" phải đánh là "ruwowju" thì chúng ta gõ "ruowju", hoặc là "ruwowuj" hay tệ nhất là "ruowuj"vẫn biết là nhanh, dù gõ nhầm dấu ở vị trí khác, nhưng dù sao nó vẫn là 1 thói quen xấu. Nếu như 1 ngày nào đó ta ko còn có Unikey, thì sẽ gõ thế nào.
  • Kiểm tra chính tả: Chúng ta ko còn cần phải biết mình viết tiếng Anh hay Việt, Unikey sẽ tự động xem cho ta...Vậy nên mới có kiểu gõ tiếng Anh rồi để nó tự convert, ví dụ như "what" với chữ ư ở đầu, ờ thì tiện nhưng khi ta ko có bộ gõ và phải dùng 1 bộ gõ javascript ở các forum, hoặc khi bộ gõ conflict với bộ gõ tích hợp, thì ta sẽ thấy tốc độ gõ giảm đến thế nào.
  • Lỗi ko sửa: đành rằng là ngừng phát triển, nhưng mà nó tạo 1 thói quen xấu ( ít nhất là cho tui ) là khi bật war3 lên sẽ lần lượt ấn Cltr, Alt, Shift ( đừng hỏi tại sao :)) ), đó là do lỗi khi tắt Unikey tạm thời bằng phím tắt với 1 vài ct dùng OpenGL

Nhưng dù sao, chúng ta cũng chọn sự tiện lợi, vì vậy tui mới cài unikey-scim =))

Categories: Post Tags: ,

Ubuntu 9.04

April 17th, 2009 Fu4ny 2 comments

Categories: Post Tags: , ,

How-to: Create Sudoer user

April 3rd, 2009 Fu4ny 3 comments

Giữ lại chút đề phòng có ngày dùng lại:
This is the method to create a user with sudo access:
First, we need to create a new user

sudo adduser user_name

Input your password 2 times, When prompted for Room number, phone number, etc.., just leave it as default value.

If you are on a Ubuntu server, just add the new user to admin group

sudo adduser user_name admin

Otherwise, you'll have to edit sudoer file.

sudo visudo

And then add your user to the last line ( I'm not going to teach you how to use Vim )

user_name ALL=(ALL)ALL

Save and then exit, login to your new user and test sudo access

Categories: Post Tags: , ,

Music and browsing take flight in Songbird

December 3rd, 2008 Fu4ny No comments

Music and browsing mashup Songbird has kicked the remnants of its shell to the curb. With the release of version 1.0.0 for Windows, Mac, and Linux, the program's main emphasis as a music browser couldn't be more clear.

SongBird

Songbird's familiar layout should make it easy for many to combine their browsing and music playback in one tool.

(Credit: Pioneers of the Inevitable)

If you looked at some of the earlier beta versions, Songbird's interface borrowed heavily from Firefox. More recent versions took their cue from iTunes, with Web browsing occurring in a second tab. Although toggling between your music library and the browser is as easy as switching tabs, since Songbird opens your library by default it's apparent where the publisher thinks users will want to focus.

This is arguably a smart strategy, too, given the attention that the latest round of browser battles has garnered. The music library layout feels intuitive, owing much to iTunes. Album art appears in the lower left corner with a navigation tree above it. A button at the bottom of the sidebar lets you toggle both. The music player controls can be configured to appear at the top or the bottom of the main window via the Views menu. Drag-and-drop would be a nice feature here, although not essential.

The Filter pane defaults to appear, and lives at the top of the interface above the browsing tabs. Again, it can be hidden in the Views menu. The Filter pane is included by default, but if you click on the dual-pane icon next to the Search box and click on Get more media views, you can install extensions that provide you with a Cover Flow facsimile, a tag cloud, and others.

The Library browsing tab is hard-coded to appear and the tab lives permanently above the left sidebar. Overall, though, the interface shouldn't be a drastic change if you're familiar with iTunes, and shares enough options with other media players that you won't feel like you're locked in to what Songbird's designers had in mind.

If you're into skins or Firefox themes, Songbird supports those as Feathers. A quick search through the feathers options on the Songbird Web site indicates that, just as with Firefox, black themes are in. Way in. Switching installed feathers works the same as in Firefox, although in Songbird the reboot happens so fast it appears as if it's doing it on the fly. A right-nav toggle reveals a pane for managing your display pane add-ons.

Songbird's not just about its plumage--it's got some meat on its bird-bones. Besides the rolled-in jukebox, there's the native support for Last.fm, and an included add-on for MashTape. Additional add-ons can provide a lyrics pane, music recommendations, and more. The audio engine is Gstreamer, which is used in all Songbird platforms, and an included plug-in provides device support that's otherwise still in beta. However, when syncing files with an iPod Classic, I ran into zero problems.

Songbird doesn't have all of the features that Firefox 3 does. The address bar lacks its "awesome" upgrade--some users will surely see that as an improvement. It appears that many of the Firefox 3 visual security improvements, such as the favicon color change and the unsafe site warning, haven't made it into Songbird.

There are other major features that are still in development. Album art fetching is not yet natively supported, nor is video playback, watch folders, or feed management. These drawbacks, though, shouldn't keep you from checking out Songbird.

via Music and browsing take flight in Songbird | Webware - CNET.

Categories: Post Tags: , , ,