Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Tuesday, October 27, 2015

Biến laptop chạy Ubuntu thành điểm phát Wifi

Nguồn

Đối với những người đam mê công nghệ thì việc sở hữu cùng lúc Laptop và smartphone là chuyện bình thường. Nếu đang ở nhà và bạn cũng không có thiết bị hỗ trợ phát wifi, hãy tận dụng chiếc Laptop để làm điểm phát wifi phục vụ nhu cầu công việc trên smartphone.

Đối với những người đam mê công nghệ thì việc sở hữu cùng lúc Laptop và smartphone là chuyện bình thường. Đối với một chiếc smartphone thì sẽ có nhiều thao tác liên quan đến hệ thống như cập nhật firmware, cập nhật phần mềm hay cài đặt phần mềm mới... đa số đều phải cần đến kết nối internet, và bạn có thể làm điều đó dễ dàng với các kết nối wifi công cộng. Tuy nhiên, nếu đang ở nhà và bạn cũng không có thiết bị hỗ trợ phát wifi, hãy tận dụng chiếc Laptop để làm điểm phát wifi phục vụ nhu cầu công việc trên smartphone.

Quá dễ dàng đối với hệ điều hành Windows, cũng như khá nhiều bài viết hướng dẫn làm đối với Windows trên các trang báo điện tử cũng như blog công nghệ. Nếu bạn đang sử dụng hệ điều hành Ubuntu thì sao? Cách làm cũng khá đơn giản, bạn có thể làm như sau:

Đầu tiên, bạn nhấn chuột vào biểu tượng Settings (hình bánh răng) ở góc trên bên phải màn hình làm việc của Ubuntu để chọn nhanh System Settings.

Trên cửa sổ System Settings, nhấn chuột vào biểu tượng Network để tiến hành các thiết lập liên quan đến mạng.

Một điều dĩ nhiên là bạn không thể vừa kết nối vừa phát wifi cùng lúc, do đó bạn cần kết nối Laptop với đường ADSL và để card wifi ở chế độ trống.

Bây giờ trên cửa sổ Network, bạn chọn tùy chọn Wireless ở sidebar bên trái. Sau đó bấm chọn Use as Hotspot trong phần tùy chọn dành cho Wireless.

Tiếp tục bấm chọn Create Hotspot để tạo một Hotspot mới.

Như vậy là Hotspot wifi đã được tạo ra từ Laptop của bạn. Tuy nhiên, để sử dụng tốt hơn, tối ưu hơn bạn cần một số thiết lập khác. Bấm vào nút Options để tiến hành các thiết lập cho Hotspot mới này.

Trên cửa sổ Edit Hotspot, tại thẻ Wireless bạn có thể đặt một số thông tin cho Hotspot như tên chẳng hạn để dễ nhận biết khi dò tìm cũng như biết thêm các thông tin khác.

Ngoài ra, để đảm bảo không có người “xài chùa” kết nối của bạn, bạn có thể thiết lập mã bảo mật bằng cách chuyển sang thẻ Wireless Security, trên thẻ này tại trường Key, bạn tiến hành nhập mật mã, để chắc chắn mật mã không bị lỗi do bộ gõ bạn có thể danh dấu vào tùy chọn Show Key để thấy rõ các ký tự mình nhập vào.

Để thiết bị khác có thể dò và kết nối được với Hotspot thì trường Method trên thẻ IPv4 Settings phải là Shared to other computers.

Sau khi đã thiết lập xong tất cả, nhấn Save... để lưu các thiết lập lại.

Như vậy là bạn đã có thể tận dụng được đường truyền Internet thông qua cáp ADSL để sử dụng cho các thiết bị di động bằng sóng wifi trên môi trường Ubuntu. Xem ra khá đơn giản so với trên môi trường Windows :)

Chú bạn thành công!

Monday, January 5, 2015

How to get Times New Roman font in LibreOffice on Linux?

If using Ubuntu then you can also install all restricted software (like fonts, Java, Flash, MP3 support etc) with one package, "restricted" in this case means: that is legal if end-user installs it itself, but not legal (so restricted) if installed automatically by distribution itself (so it can't be installed by default). End-user must accept license terms - by selected "Yes" - I agree with license.
  1. Ubuntu Software Center | Edit | Software Sources | "Other software" tab | check both partner repositories.
  2. From terminal (or Software Center itself):
    sudo apt-get update
    sudo apt-get install ubuntu-restricted-extras
  3. After install restart LibreOffice to get accepted this fonts.
If you don't want to install of the restricted software, then in Software Center type in "Microsoft" and one of the search result is going to be Microsoft fonts. Install that package.
One additional info. In Ubuntu there should already be Liberation fonts. There are very very similar to Microsoft fonts and this Liberation fonts are free of use (no restriction). Check them out, I think professor will most probably not notice the difference: https://en.wikipedia.org/wiki/Liberation_fonts

Source

Wednesday, December 31, 2014

Stata Gedit Integration

Integrate Gedit with Stata

1. Go to Edit - Preferences - Plugins and activate "External Tools"
(if you cannot activate any plugins, run gedit as a root with "sudo gedit")
2. Go to Tools - Manage External Tools
3. Click on "+" to add a new tool
4. Name the new tool as you wish, e.g., Stata dolines
5. Copy the body of "Gedit_stata_integration_script.txt" in the command space
6. Choose the keyboard shortcut, e.g. "F9"
7. Choose to send only currently highlighted text from the drop-down menu
do /tmp/stata


PS: You might need to install xdotool if it is not currently installed:
sudo get-apt install xdotool

Stata Syntax Highlighting in Gedit

(All credits go to: http://linuxscrapbook.wordpress.com/2010/12/01/stata-syntax-highlighting-for-gedit/ and
http://forums.debian.net/viewtopic.php?f=8&t=55704)

1. Copy  stata.lang file to /usr/share/gtksourceview-3.0/language-specs (for use by all users on the system, requires superuser privileges)

or to ~/.local/share/gtksourceview-3.0/language-specs (for use with your account only) For the latter option, you may have to create the directory first:

mkdir -p ~/.local/share/gtksourceview-3.0/language-specs

For Windows: copy stata.lang file to ProgramFiles (x86)\gedit\share\gtksourceview-3.0.

2. Restart gedit.

.do files are now recognized automatically. For manual selection of the Stata Highlight Mode, go to View > Highlight Mode > Scientific > stata


Nice color scheme in Gedit:

1. Copy solarized_light.xml or solarized_dark.xml (or both) to /usr/share/gtksourceview-3.0/styles (or respective directory) and choose the one you like the best





Source

#!/bin/sh
#!/bin/bash

# Clear temporary-do file if it already exists

[ -e /tmp/stata.do ] && rm /tmp/stata.do

# Write each highlighted lign in the temporary do-file /tmp/stata.do
# - "OLDLINE" is needed just in case if the last line doesn't end with an EOL symbol (in this case, "read LINE" returns "false" and this line is not written in the temporary do-file

while read LINE; do
  echo $LINE >> /tmp/stata.do
  OLDLINE=$LINE
done
if [ "$LINE" != "$OLDLINE" ] ; then
    echo $LINE >> /tmp/stata.do
fi

# check whether the Stata process is runnung already
# for other stata versions change the window title (you can read it on the top of the open Xstata window)

 STATAID=`xdotool search --name "Stata/SE 12.0" | head -n 1`

# if Stata is already running, activate the window; if not, launch the Stata process, wait until it is running, and then activate the window

 if [ -n "$STATAID" ]; then
     xdotool search --name "Stata/SE 12.0" windowactivate %1
 
   # if runnning 2 Stata windows; choose the necessary window number %1 or %2 (play around to identify which window you need)

   
 else
    /usr/local/stata12/xstata-se  &
    sleep 1
    search --name "Stata/SE 12.0" windowactivate

fi

# In the Stata window, activate the command line with Ctrl+4 ,
# and then type "do /tmp/stata [RETURN]"

xdotool key "ctrl+4" && xdotool type "do /tmp/stata" && xdotool key "Return"




Tuesday, October 21, 2014

Boot window 8.1 before Ubuntu

Step 1: Search EasyBCD on google.com
Download and install

Step 2: Add entry
Operating Systems/Linux BSD
- Type: GRUB2
- Name: Ubuntu (or Custom)
- Drive: Automatically locate and load
-> Click Add Entry

Step 3: BCD Deployment
Click write MBR

Step3: Restart to see result

Delete Ubuntu and fix windows boot


Step 1: Delete Ubuntu in windows
Right click on My Computer/ manage/ Disk management
Right click on Ubuntu disk/ Delete and format
Restart
Step 2: Fix Boot

Using Windows 8
Boot by boot cd or windows disk DVD
From command promt
attrib - s -h c:\boot\bcd - remove system and hidden attributes so it can be deleted.
del c:\boot\bcd - delete BCD
bcdboot c:\windows - re/create BCD

Using Windows 2000, Windows XP or Windows Server 2003 CD:

Boot using setup disc and enter into "Recovery Console" by pressing "R" key, select your Windows installation and enter Administrator password. If you don't have any password, press Enter key. Now run following command:
fixmbr
Press "Y" to confirm and type Exit to exit from recovery console.

Using Windows 98 CD:

Boot into Command Prompt and run following command:
fdisk /MBR
Exit from command prompt by typing Exit and press Enter.Reference

Sunday, October 5, 2014

Ubuntu-VN Repository

Danh sách phần mềm

Danh sách các phần mềm/gói hiện có trong kho của Ubuntu-VN:
  1. scim-unikey - Engine xử lý tiếng Việt cho SCIM
  2. x-unikey - Bộ gõ x-unikey, được áp dụng 1 số patch để có thể sử dụng tốt với im-switch
  3. vietnam-fonts - Gói không chứa font, dùng để cài nhanh 2 gói bên dưới
    • vietnam-abc-fonts - Gói cài đặt 105 font ABC
    • vietnam-vni-fonts - Gói cài đặt 113 font VNI
  4. stardict-free-vietnamese-dict - Gói không chứa từ điển - dùng cài đặt nhanh các gói bên dưới
    • stardict-english-vietnamese - từ điển Anh - Việt
    • stardict-french-vietnamese - từ điển Pháp - Việt
    • stardict-german-vietnamese - từ điển Đức - Việt
    • stardict-norwegian-vietnamese - từ điển Na Uy - Việt
    • stardict-russian-vietnamese - từ điển Nga - Việt
    • stardict-vietnamese-english - từ điển Việt - Anh
    • stardict-vietnamese-french - từ điển Việt - Pháp
    • stardict-vietnamese-german - từ điển Việt - Đức
    • stardict-vietnamese-vietnamese - từ điển Việt - Việt

Cài đặt kho

Dùng Software Sources

Thêm mã xác thực của Ubuntu-VN PPA
  1. Tải public key về tại địa chỉ http://www.ubuntu-vn.org/ubuntu-vn_ppa.key
  2. Vào menu System->Administration->Software Sources
  3. Ở tab Authentication, click Import Key File... -> chọn đường dẫn đến file tải về -> Ok
Thêm APT source list
  1. Vào menu System->Administration->Software Sources
  2. Ở tab Third-Party Software, lần lượt Add các dòng sau vào (tùy theo phiên bản Ubuntu đang dùng)
  • Ubuntu 9.10
deb http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu karmic main     #Ubuntu-VN - Ubuntu 9.10 "Karmic Koala"
deb-src http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu karmic main #Ubuntu-VN - Ubuntu 9.10 "Karmic Koala" 
  • Ubuntu 9.04
deb http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu jaunty main     #Ubuntu-VN - Ubuntu 9.04 "Jaunty Jackalope"
deb-src http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu jaunty main #Ubuntu-VN - Ubuntu 9.04 "Jaunty Jackalope" 
  • Ubuntu 8.10
deb http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu intrepid main     #Ubuntu-VN - Ubuntu 8.10 "Intrepid Ibex"
deb-src http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu intrepid main #Ubuntu-VN - Ubuntu 8.10 "Intrepid Ibex"
  • Ubuntu 8.04
deb http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu hardy main     #Ubuntu-VN - Ubuntu 8.04 "Hardy Heron"
deb-src http://ppa.launchpad.net/ubuntu-vn/ppa/ubuntu hardy main #Ubuntu-VN - Ubuntu 8.04 "Hardy Heron"

Dùng Command Line

Mở Terminal và đánh vào lệnh phù hợp:
Thêm mã xác thực của Ubuntu-VN PPA
wget -q http://www.ubuntu-vn.org/ubuntu-vn_ppa.key -O- | \
sudo apt-key add -
hoặc
sudo apt-key adv --recv-keys --keyserver \
keyserver.ubuntu.com 81E7FE09
Thêm APT source list
Tùy theo phiên bản Ubuntu đang dùng bạn chọn lệnh thích hợp

  • Ubuntu 9.04
sudo wget http://www.ubuntu-vn.org/jaunty.list -O \
/etc/apt/sources.list.d/ubuntu-vn.list
  • Ubuntu 8.10
sudo wget http://www.ubuntu-vn.org/intrepid.list -O \
/etc/apt/sources.list.d/ubuntu-vn.list 
  • Ubuntu 8.04
sudo wget http://www.ubuntu-vn.org/hardy.list -O \
/etc/apt/sources.list.d/ubuntu-vn.list

Cài Offline

  1. Truy cập địa chỉ sau: https://launchpad.net/~ubuntu-vn/+archive/ppa
  2. Chọn tên gói và phiên bản phù hợp
  3. Ở phần Package files, chọn gói deb phù hợp
    • i386: cho Ubuntu 32bit
    • amd64: cho Ubuntu 64bit
    • lpia: cho Ubuntu Mobile
    • all: dùng chung cho tất cả kiến trúc
  4. Tải về và cài đặt



source: http://wiki.ubuntu-vn.org/index.php/Ubuntu-VN_Repository

Saturday, October 4, 2014

install by apt synaptic in ubuntu

search source at

ex: http://packages.ubuntu.com/search?keywords=libgnomeprint&searchon=names&suite=saucy&section=all

adm64
http://packages.ubuntu.com/saucy/amd64/libgnomeprint2.2-0/download
i386
deb http://cz.archive.ubuntu.com/ubuntu saucy main universe

https://packages.debian.org/sid/m68k/libgtksourceview1.0-0/download

add to sources.list
gedit /etc/apt/sources.list
save as /home /[nnb]
cd /home/nnb/
mv sources.list /etc/apt/
sudo apt install libgnomeprint2.2-0
sudo apt-get install libgtksourceview1.0-0

Adding this PPA to your system

This PPA contains the latest release of Grub Customizer.
sudo add-apt-repository ppa:danielrichter2007/grub-customizer
sudo apt-get update
sudo apt-get install grub-customizer

Update, Upgrade và cài bộ gõ tiếng việt

Update, Upgrade

Mặc định đĩa cài đặt Ubuntu tuy rất mới nhưng vẫn còn thiếu một số gói lệnh hoặc có một số update mới. Bạn chỉ việc đơn giản chạy các dòng lệnh sau để cho hệ điều hành tự động update và upgrade

sudo apt-get update
sudo apt-get upgrade

Cài bộ gõ tiếng Việt

sudo apt-get install ibus-unikey 
Install windows fonts
                    sudo apt-get install msttcorefonts

Install wine1.7
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get update
sudo apt-get install wine1.7

Install dropbox
sudo apt-get -y install nautilus-dropbox
Install GOOGLE DRIVE
sudo apt-add-repository ppa:thefanclub/grive-tools
sudo apt-get update
sudo apt-get install -y grive-tools
Search app
apt-cache search
Explore
sudo apt-get install nautilus 

Clean up Ubuntu

Dọn dẹp lại những thứ dư thừa trong quá trình cài đặt

echo "Cleaning Up" &&
sudo apt-get -f install &&
sudo apt-get autoremove &&
sudo apt-get -y autoclean &&
sudo apt-get -y clean

Switch ubuntu to edubuntu and etc

You can try the following:
sudo apt-get install edubuntu-desktop
sudo apt-get install kubuntu-desktop
sudo apt-get install lubuntu-desktop
sudo apt-get install xubuntu-desktop

sudo apt-get remove edubuntu-desktop

Just be aware that this will take up a large chunk of your harddrive, and add a ton of extra programs that you probably don't need(most of them are KDE versions of GNOME programs/XFCE programs whatever, like instead of gnome-terminal, it is the konsole I believe, or is it Kterminal, i dunno...).

Apart from that to Switch Between The New Unity Lockscreen And LightDM In Ubuntu 14.04
Firstly install CompizConfig Settings Manager (CCSM):
sudo apt-get install compizconfig-settings-manager
Then open CompizConfig Settings Manager, click on Ubuntu Unity Plugin and on the General tab, under "Lockscreen", you can select to use Unity, LightDM or no lockscreen:
That's it - there's no need to restart the system or log out, the settings should be applied instantly.

You can switch between desktop environments by logging out, and choosing which environment with a selection box in one of the corners of the screen.

Once you are done playing around with the other environments, go into synaptic and get rid of the kubuntu-desktop and all others you got, but this won't get rid of any programs that were installed along side it. For that check out this site...
http://www.psychocats.net/ubuntu/puregnome

Transform to MacBuntu
http://www.noobslab.com/2014/04/macbuntu-1404-pack-is-released.html