Posts

Showing posts with the label Linux

How to restart iBus on Fedora to use GNOME 3

Image
ibus on Fedora to use Gnome 3 not provide to restart it. So, if you want to restart ibus, you may try doing the below steps: Step 1: To kill current ibus daemon pkill -o ibus-daemon Step 2:  To start a new ibus daemon in Gnome 3, run this command in “Enter a command” tool by Alt+F2 /usr/bin/ibus-daemon --replace --xim --panel disable End.

Convert Unix timestamp to a date string in Linux

  With GNU's   date   you can do: date - d "@$TIMESTAMP" # date -d @0 Wed Dec 31 19 : 00 : 00 EST 1969 On OS X, use  date -r . date - r "$TIMESTAMP" Alternatively, use  strftime() . It's not available directly from the shell, but you can access it via gawk. The  %c  specifier displays the timestamp in a locale-dependent manner. echo "$TIMESTAMP" | gawk '{print strftime("%c", $0)}' # echo 0 | gawk '{print strftime("%c", $0)}' Wed 31 Dec 1969 07 : 00 : 00 PM EST

Scanning a Linux Server for Malware and Virus by ClamAV

Image
The ClamAV antivirus software and how to use it to protect your server or desktop (Linux/Windows platform. It's also worth noting that ClamAV doesn't behave like a Windows antivirus. It doesn't hog up RAM or run in the background all the time. It also doesn't have all of the extra bells and whistles. It scans for viruses, and that's about all. 1. SETUP - Install on Fedora/CentOS/Redhat yum install clamav - Install on Debian/Ubuntu apt-get install clamav - Compile from source code   + Download:  http://www.clamav.net/downloads/production/clamav-0.100.0.tar.gz   + Compile: tar xvf  clamav-0.100.0.tar.gz cd clamav-0.100.0/ ./configure --prefix=/opt/clamav make sudo make install All pages will be placed in /opt/clamav 2. CONFIGURING All Clamav's configuration in /opt/clamav/etc (contains 2 files: clamav.conf and freshclam.conf) - clamd.conf (The configuration file save all Clamav's configrations) # BASIC LogFile /var/log/clamd.log...

ZSH tips

Image
ZSH's tips man zsh Zsh overview man zshmisc Anything not fitting into the other sections man zshexpn Zsh command and parameter expansion man zshparam Zsh parameters man zshoptions Zsh options man zshbuiltins Zsh built-in functions man zshzle Zsh command line editing man zshcompwid Zsh completion widgets man zshcompsys Zsh completion system man zshcompctl Zsh completion control man zshmodules Zsh loadable modules man zshzftpsys Zsh built-in FTP client man zshall Meta-man page containing all of the above info --index-search=age zsh # get man info for zsh function age *N* zinfo(){info --index-search=$1 zsh} *N* /usr/share/zsh/htmldoc/zsh_toc.html Install on Linux > yum install zsh *N* > yum update zsh *N* # install from source ver=5.5.1 wget --no-check-certificate https://sourceforge.net/projects/zsh/files/zsh/$ver/zsh-$ver.tar.gz tar zxvf zsh-$ver.tar.gz yum install gcc ncurses-devel # if required cd zsh-$ver ...

Sửa lỗi gõ tiếng Việt trên Chrome Ubuntu 14

Lôi này hay gặp khi sử dụng iBus để gõ TV, cách khắc ất đơn giản chỉ cần export thêm vào cuối ~/.profile export GTK_IM_MODULE=xim export QT4_IM_MODULE=xim export QT_IM_MODULE=xim export XMODIFIERS=@im=ibus ibus-daemon -drx Logout ra vào lại sẽ OK.

Tự động mount partition NTFS trong Ubuntu

Image
Thông thường khi chuyển từ hệ điều hành Windows sang Linux (vd: Distro là Ubuntu), hầu hết mọi người vẫn giữ phân vùng chứa định dạng NTFS của Windows. Trong bài viết này, tôi sẽ hướng dẫn cách mount phân vùng NTFS vào hệ thống để hoạt động bình thường như các phân vùng EXT của Linux. Bước 1: Kiểm tra UUID của phân vùng NTFS cần mount sudo bklid Bước 2: Sau khi biết được thông số UUID của phân vùng NTFS cần mount, mở file /etc/fstab và thêm: UUID=xxxxxxxxxxx /mnt/Windows ntfs users,defaults 0 0 Trong đó: - UUID: Là thông số UUID của phân vùng NTFS cần mount - /mnt/Windown : Là phân thư mục mà phân vùng NTFS được mount vào. Bước 3: Reboot lại máy để nhận cấu hình mới Kết thúc :)

Khắc phục lỗi không gõ được tiếng việt bằng ibus-unikey với các ứng dụng Qt/KDE trên Ubuntu Linux

Thông thường, khi cài đặt gói  ibus-unikey  để gõ tiếng việt trên hệ thống thì theo mặc định gói  ibus-qt  không được cài đặt cùng, để gõ được tiếng việt trong các ứng dụng sử dụng Qt/KDE (gọi tắt là các ứng dụng Qt) thì ngoài việc cài đặt thêm gói ibus-qt nói trên, bạn cần cấu hình bộ nhập liệu mặc định trên Qt bằng cách: Chạy thiết lập cấu hình cho Qt với lệnh  qtconfig Chuyển đến thẻ  Interface , trong mục  Default Input Method  chọn  ibus  sau đó đóng phần thiết lập cấu hình này. Như vậy từ giờ trở đi các bộ gõ (nhập liệu ngôn ngữ) họ ibus sẽ hoạt động bình thường trên các ứng dụng Qt, tuy nhiên vẫn có những trường hợp ngoại lệ, chẳng hạn như không thể gõ tiếng việt, thậm chí là chuyển bộ gõ trong Libre Office phiên bản từ 3.5.4 trở lên, để khắc phục nó ta cần khai báo ibus hoạt động như một dịch vụ bằng cách thêm các dòng sau vào tập tin  ~/.bashrc  và  ~/.xprofile   /etc/profile  bởi vì hệ thống sẽ n...

Mục đích của /var/lock/subsystem

Trích nguyên văn :) " Why do init scripts require lock files? When a service is started through an init script, a file is touched in the /var/lock/subsys/ directory with the same name as the init script. When the service is stopped, this file is removed. The contents of this file are unimportant for the scope of this article, as long as the filename is the same as the init script. This file represents that a service's subsystem is locked, which means the service should be running. Since a service may consist of multiple executables with different names, finding the process ID (PID) of a single executable may not be sufficient to determine the status of the entire service itself. For this reason, the command: service <initscript> status checks both the PID of the executable and the file in the /var/lock/subsys/ directory. If the PID is not found but the subsystem is locked, you will receive a message similar to this: <service> dead but subsys locked Managi...

Sử dụng nload để mornitor traffic và bandwidth network thời gian thực

Image
Nếu bạn muốn kiểm tra xem traffic và bandwidth network hiện tại của server Linux đang quản lý như thế nào, công cụ nload sẽ giúp bạn làm điều này. Nload hoạt động khá nhẹ, kiểm tra traffic và bandwidth network realtime giúp cho người quản trị hệ thống có kênh thông tin hữu ích về hoạt động mạng hiện tại trên server. 1. Cài đặt - Download:  http://sourceforge.net/projects/nload/ Version mới nhất tại thời điểm hiện tại sử dụng trong bài viết là nload -0.7.4. - Buidl từ source code: tar xvf /path/to/nload-0.7.4.tar.gz cd /path/to/nload-0.7.4/ ./configure --prefix=/usr/local/nload make make install Trong phần cài đặt trên, mặc định tôi cài đặt nload tại thư mục /usr/local/nload. 2. Chạy nload Việc sử dụng nload khá đơn giản, ví dụ tôi cần monitor card mạng eth0, sử dụng nload như sau: /usr/local/nload/bin/nload eth0 Output sẽ hiện thị: Đối với card mạng khác sử dụng tương tự.

Cài đặt Mariadb 5 từ yum

Image
MariaDB 5.5 Add Mariabd repo vào yum Tạo file  MariaDB.repo trong thư mục /etc/yum.repos.d/ : Trên RHEL 6 32-bit # MariaDB 5.5 RedHat repository list - created 2013-08-11 14:29 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/rhel6-x86 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 Trên RHEL 6 64-bit # MariaDB 5.5 RedHat repository list - created 2013-08-11 14:30 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/rhel6-amd64 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 Trên RHEL 5 32-bit # MariaDB 5.5 RedHat repository list - created 2013-08-11 14:31 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/5.5/rhel5-x86 gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 Trên RHEL 5 64-bit # MariaDB 5.5 RedHat repository list - created 2013-0...