when copy and paste in vi it automatically inserts many annoying indents and tabs. To disable the auto indents and formatting, use this command before you paste
:set paste
and paste your codes. After that, set it back
:set nopaste
when copy and paste in vi it automatically inserts many annoying indents and tabs. To disable the auto indents and formatting, use this command before you paste
:set paste
and paste your codes. After that, set it back
:set nopaste
I just had no luck searching for this topic. Any one come across the same idea please shed me some lights.
Any cheap (universal) programmer out there can be used to compile 8051 C programs and also capable of writing the hex file into 8051 derivatives? I would also like to know what packages/compilers/similators to drive this programmer.
For some reason Ubuntu 8.04 didn’t install vim by default, thus no syntax.
There’s also another tips I always forgot. vim has a very nice autocomplete feature. For example you’ve a variable name “apple”, you can type “ap”, then press Ctrl-n or ctrl-p, it would show all the functions and variables start with “ap”.
For some reason, Ubuntu changed the default system shell from bash to dash. To what I noticed, I didn’t see any speed improvement but many scripts shows error or are not compatible.
To restore the whole system back to bash, call this command:
sudo dpkg-reconfigure dash
I always prefer to install the OS in English and enable the Chinese typing tool. The Chinese fonts on applications tool bars just don’t make much sense to me. However, enabling the Chinese tool (scim) is not done by default if I install the OS these way, so I dropped down the notes here because these steps are easily forgotten and not straight forward.
GTK_IM_MODULE=”scim”
QT_IM_MODULE=”scim”
P.S. After the scim toolbar is poping up, you still need to right click the toolbar to setup what input method you would like to use. Personally, I used Changjie3 to type Chinese, it seems the closest to the Windows version of Changjie.
Sometimes when yum is not updating, or simply not synchronized with the repository, it’s a good idea to clean up the cache database and fetch a new list from the server.
Somehow I tend to move the files to /tmp/ rather then just remove them, since the rm -rf command is the No. 1 enemy of idiocity.
If you install your Linux box with English as the primary language, you will notice the Chinese fonts are blurred and hard to read. That is due to anti-aliasing of Chinese characters. I would NOT recommend to disable all font anti-aliasing in Font Preferences, because anti-alias is good and it makes many fonts look easier for eyes, just not Chinese characters when they are small.
The solution is so set false for Chinese fonts under a specific font size. Create a file called local.conf under /etc/fonts/ directory
vi /etc/fonts/local.conf
and copy and paste the following to the file:
<?xml version=”1.0″?><!DOCTYPE fontconfig SYSTEM “fonts.dtd”>
<fontconfig>
<!– Disable font alias for Chinese <= 18px –>
<match target=”font”>
<test qual=”any” name=”family” compare=”eq”>
<string>AR PL Mingti2L Big5</string>
<string>AR PL SungtiL Big5</string>
<string>AR PL New Sung</string>
<string>AR PL ShanHeiSun Uni</string>
<string>AR PL ZenKai Uni</string>
<string>Ming(ISO10646)</string>
<string>MingLiu</string>
<string>PMingLiu</string>
<string>Kochi Mincho</string>
<string>Baekmuk Dotum</string>
</test>
<test name=”pixelsize” compare=”less_eq”>
<double>18</double>
</test>
<edit name=”antialias”>
<bool>false</bool>
</edit>
<edit name=”hinting”>
<bool>true</bool>
</edit>
</match>
<alias>
<family>serif</family>
<prefer>
<family>Bitstream Vera Serif</family>
<family>Times New Roman</family>
<family>Times</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL Mingti2L Big5</family>
<family>AR PL SungtiL GB</family>
<family>SimSun</family>
</prefer>
</alias>
<alias>
<family>sans-serif</family>
<prefer>
<family>Bitstream Vera Sans</family>
<family>Arial</family>
<family>Verdana</family>
<family>Helvetica</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
<family>AR PL kaitiM Big5</family>
<family>AR PL kaitiM GB</family>
</prefer>
</alias>
<alias>
<family>monospace</family>
<prefer>
<family>Bitstream Vera Sans Mono</family>
<family>Courier New</family>
<family>Courier</family>
<family>AR PL New Sung</family>
<family>AR PL ShanHeiSun Uni</family>
</prefer>
</alias>
</fontconfig>
When importing wordpress to wordpress database, there are several problems I encountered.
Fixes:
- change mode of your upload directory to writable (chmod 777 uploads)
- edit the apache php.ini file to increase the file upload limits
- vi /etc/php5/apache2/php.ini
- change “memory_limit” from 8M to 20M, or more
- change “upload_max_filesize” from 5M to 20M, or more
- restart your apache server: /etc/init.d/apache restart
After all these modifications, you should be able to import your wordpress xml file. Good luck!
patch is a open source tool used to apply bug fix, and diff is a tool for generating patch files.
diff
1. prepare the original and the modified source code directory, say project.orig/ and project.mod/
2. make clean to remove the binaries
3. apply diff command at the root level of directory, and pipe them into a patch fileFor example:
diff -ru -xCVS -x’.#*’ -x’*.so’ -x’*~’ -x’*conf*’ -x’*.P*’ -x’Makefile*’ project.orig/ project.mod/ > project.patch
if you see unwanted diff of configure or binary files, add prefix -x to exclude those files as in the example.
patch
patch -p1 < project.patch
to reverse the patch,add -R option
patch -Rp1 < project.patch
This problem has been troubling me until recently. When I use the vi editor as user “root”, the vi syntax is not working. However, the vi syntax works perfectly fine when you log on as other user.
The solution is simple, use vim instead of vi.
The cause of this lies in in /etc/profile.d/vim.* . vi only aliases to vim for user id greater than 100. User “root” is lower than 100 so it isn’t not aliased.
I believe the syntax files may not be available during boot level 1(single user mode), so vim is only used for other users.
—-
Note:
If you don’t even have syntax color for normal users, make sure you have vim-full installed
$ apt-get install vim-full
then in vi, turn it on by : syntax on
or edit /etc/vim/vimrc and turn it on by default