用 sed 去掉 去掉windows下的回车符
(注意^M 在linux 下写法 按^M 是回车换行符,输入方法是按住CTRL+v,松开v,按m)
sed -i 's/^M//g' df.txt
Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts
Tuesday, 25 September 2012
Thursday, 29 September 2011
Ubuntu 11.04 natty 下安装 qq for linux 失败
终于闲了下,准备在我的PC上安装个QQ。结果失败:
dpkg: error processing linuxqq_v1.0.2-beta1_i386.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 7 package 'linuxqq':
error in Version string 'v1.0.2-beta1': version number does not start with digit
Errors were encountered while processing:
linuxqq_v1.0.2-beta1_i386.deb
于是google下找到了答案:
dpkg: error processing linuxqq_v1.0.2-beta1_i386.deb (--install):
parsing file '/var/lib/dpkg/tmp.ci/control' near line 7 package 'linuxqq':
error in Version string 'v1.0.2-beta1': version number does not start with digit
Errors were encountered while processing:
linuxqq_v1.0.2-beta1_i386.deb
于是google下找到了答案:
原版LinuxQQ下载地址: http://im.qq.com/qq/linux/download.shtml
忍不住抱怨下,腾讯,难道你就没有linux工程师了?
Monday, 16 May 2011
my thinking after reading Ubuntu Pocket Guide and Reference
It took me sometime to finish reading this book:
Ubuntu Pocket Guide and Reference
It's nice especial for the beginners.
You can download here for free.
How to get your wireless card working under Linux?
“Getting the card to work is simple! Just grab the
source code for the module and compile it against
the kernel. insmod it and then use iwconfig to configure a
WEP password—”
That's why Linux was “for techies only“.
Now it's so easy.
Desktop Linux systems changed everything.
Ubuntu is one of them.
If you can use Windows, you can use Ubuntu.
For it free, safe, faster and ease of use. why not use Linux?
chapter 1 installation
Skip, for It's really easy now, just follow the steps.
chapter 2 Configuring Ubuntu
Every major area of hardware. Make them works.
chapter 3 Getting to grips with the desktop
The basic knowledge to use this desktop.
chapter 4 Users and the filesystem
The purpose of this chapter is tell you the file& folder:
names, paths, permissions, locations...
chapter 5 Hands‐on at the command‐line
From zero to hero studying Shell/Bash in this chapter. It's great, not too hard, and contain lots of useful commands, suitable for the beginners. I wrote a PPT to introduce bash to the beginners, I felt that PPT is so ugly after I read this chapter. I can get more information from this book to update my PPT when needed.
chapter 6 Software management
Almost tells the two tools: the Advanced Packaging Tool (APT), and the Debian Package system (dpkg), and use APT or dpkg installing/uninstalling packages.
This chapter also introduces the: software repositories. I only want to say: "change it to get the best download speed!"
chapter 7 Securing the system
This chapter tells you:
How to use Update Manager to update the system? need it ?
Configuring the firewall.
Need an antivirus program? I don't think so, Linux is much safer than Windows even without an antivirus program.
From this book, I got the name of some books I want to read:
The Pragmatic Programmers -- Ubuntu Kung Fu
www.pragprog.com/titles/ktuk/ubuntu‐kung‐fu
Paper Book ($34.95)
eBook ($22.00)
too expensive for me...
Free Software Magazine, published in a free PDF
edition roughly every two months and covering matters relating to the
world of Free Software, including but not limited to Linux. www.freesoftwaremagazine.com.
Ubuntu Pocket Guide and Reference
It's nice especial for the beginners.
You can download here for free.
How to get your wireless card working under Linux?
“Getting the card to work is simple! Just grab the
source code for the module and compile it against
the kernel. insmod it and then use iwconfig to configure a
WEP password—”
That's why Linux was “for techies only“.
Now it's so easy.
Desktop Linux systems changed everything.
Ubuntu is one of them.
If you can use Windows, you can use Ubuntu.
For it free, safe, faster and ease of use. why not use Linux?
chapter 1 installation
Skip, for It's really easy now, just follow the steps.
chapter 2 Configuring Ubuntu
Every major area of hardware. Make them works.
chapter 3 Getting to grips with the desktop
The basic knowledge to use this desktop.
chapter 4 Users and the filesystem
The purpose of this chapter is tell you the file& folder:
names, paths, permissions, locations...
chapter 5 Hands‐on at the command‐line
From zero to hero studying Shell/Bash in this chapter. It's great, not too hard, and contain lots of useful commands, suitable for the beginners. I wrote a PPT to introduce bash to the beginners, I felt that PPT is so ugly after I read this chapter. I can get more information from this book to update my PPT when needed.
chapter 6 Software management
Almost tells the two tools: the Advanced Packaging Tool (APT), and the Debian Package system (dpkg), and use APT or dpkg installing/uninstalling packages.
This chapter also introduces the: software repositories. I only want to say: "change it to get the best download speed!"
chapter 7 Securing the system
This chapter tells you:
How to use Update Manager to update the system? need it ?
Configuring the firewall.
Need an antivirus program? I don't think so, Linux is much safer than Windows even without an antivirus program.
From this book, I got the name of some books I want to read:
The Pragmatic Programmers -- Ubuntu Kung Fu
www.pragprog.com/titles/ktuk/ubuntu‐kung‐fu
Paper Book ($34.95)
eBook ($22.00)
too expensive for me...

Free Software Magazine, published in a free PDF
edition roughly every two months and covering matters relating to the
world of Free Software, including but not limited to Linux. www.freesoftwaremagazine.com.
Thursday, 24 March 2011
ContestAppletProd.jnlp error and solve
ContestAppletProd.jnlp error and solve
There are two versions of java in my PC, and the defult one is java-1.5.0-sun.
I want to use java-6-sun because I am using the JAVA application //ContestAppletProd.jnlp//
from the TopCoder.
That's a really interesting web:
http://www.topcoder.com
Choose java 6, but there's error messages.
$update-java-alternatives -l
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-6-sun 63 /usr/lib/jvm/java-6-sun
$sudo update-java-alternatives -s java-6-sun
update-alternatives: error: no alternatives for firefox-javaplugin.so.
update-alternatives: error: no alternatives for iceape-javaplugin.so.
update-alternatives: error: no alternatives for iceweasel-javaplugin.so.
update-alternatives: error: no alternatives for midbrowser-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-firefox-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-snapshot-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so
Then install the plugins.
$sudo apt-get install sun-java6-plugin
$sudo update-java-alternatives -s java-6-sun
There's also some plugins I can't find.
But I found:
The defult app to open //ContestAppletProd.jnlp// is //Sun Java 5.0 Web Start//.
When I use it there comes out the error message:
com.topcoder.client.ui.UIManagerConfigurationException: The XML configuration for this UI is invalid at line 3 column 85.
at com.topcoder.client.ui.impl.XMLUIManager.create(Unknown Source)
at com.topcoder.client.ui.impl.XMLUIManager.create(Unknown Source)
at com.topcoder.client.contestApplet.ContestApplet.(Unknown Source)
at com.topcoder.client.contestApplet.runner.generic.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1200)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1147)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:990)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:519)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:219)
at com.sun.javaws.Launcher.run(Launcher.java:166)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.topcoder.client.ui.UIManagerConfigurationException: The Swing defaults XML configuration is invalid at line 2 column 84.
at com.topcoder.client.ui.impl.XMLUIManager$ConfigurationContentHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:220)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
... 15 more
Caused by: com.topcoder.client.ui.UIManagerConfigurationException: The Swing defaults XML configuration is invalid at line 2 column 84.
at com.topcoder.client.ui.impl.xml.swing.XMLSwingDefaults.set(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
... 25 more
Caused by: org.xml.sax.SAXParseException: Unknown element 'scheme'.
at com.topcoder.client.ui.impl.xml.swing.XMLSwingDefaults$SwingDefaultsHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
... 30 more
And I must use the 6.0. After the java 6 installed, then can use the application //Sun Java 6 Web Start//
to open //ContestAppletProd.jnlp//.
all ok.
I can use the app and enjoy the c++ coding.
: )
There are two versions of java in my PC, and the defult one is java-1.5.0-sun.
I want to use java-6-sun because I am using the JAVA application //ContestAppletProd.jnlp//
from the TopCoder.
That's a really interesting web:
http://www.topcoder.com
Choose java 6, but there's error messages.
$update-java-alternatives -l
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun
java-6-sun 63 /usr/lib/jvm/java-6-sun
$sudo update-java-alternatives -s java-6-sun
update-alternatives: error: no alternatives for firefox-javaplugin.so.
update-alternatives: error: no alternatives for iceape-javaplugin.so.
update-alternatives: error: no alternatives for iceweasel-javaplugin.so.
update-alternatives: error: no alternatives for midbrowser-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-firefox-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-snapshot-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-javaplugin.so.
update-alternatives: error: no alternatives for mozilla-javaplugin.so.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so
Then install the plugins.
$sudo apt-get install sun-java6-plugin
$sudo update-java-alternatives -s java-6-sun
There's also some plugins I can't find.
But I found:
The defult app to open //ContestAppletProd.jnlp// is //Sun Java 5.0 Web Start//.
When I use it there comes out the error message:
com.topcoder.client.ui.UIManagerConfigurationException: The XML configuration for this UI is invalid at line 3 column 85.
at com.topcoder.client.ui.impl.XMLUIManager.create(Unknown Source)
at com.topcoder.client.ui.impl.XMLUIManager.create(Unknown Source)
at com.topcoder.client.contestApplet.ContestApplet.
at com.topcoder.client.contestApplet.runner.generic.main(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1200)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1147)
at com.sun.javaws.Launcher.continueLaunch(Launcher.java:990)
at com.sun.javaws.Launcher.handleApplicationDesc(Launcher.java:519)
at com.sun.javaws.Launcher.handleLaunchFile(Launcher.java:219)
at com.sun.javaws.Launcher.run(Launcher.java:166)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.topcoder.client.ui.UIManagerConfigurationException: The Swing defaults XML configuration is invalid at line 2 column 84.
at com.topcoder.client.ui.impl.XMLUIManager$ConfigurationContentHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:220)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:322)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1693)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
... 15 more
Caused by: com.topcoder.client.ui.UIManagerConfigurationException: The Swing defaults XML configuration is invalid at line 2 column 84.
at com.topcoder.client.ui.impl.xml.swing.XMLSwingDefaults.set(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:592)
... 25 more
Caused by: org.xml.sax.SAXParseException: Unknown element 'scheme'.
at com.topcoder.client.ui.impl.xml.swing.XMLSwingDefaults$SwingDefaultsHandler.startElement(Unknown Source)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:533)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:330)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRootElementHook(XMLNSDocumentScannerImpl.java:779)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1794)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:368)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:834)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:148)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1242)
... 30 more
And I must use the 6.0. After the java 6 installed, then can use the application //Sun Java 6 Web Start//
to open //ContestAppletProd.jnlp//.
all ok.
I can use the app and enjoy the c++ coding.
: )
Tuesday, 28 December 2010
basic git command
git is the fast version control system
Now I am studying how to use git
- Here are the commands for common using:
- Use git clone to check out sources. i.e. Download pulseaudio sources:
git clone git://git.0pointer.de/pulseaudio.git
- Use git status to show your working tree status
git status
- Use git pull to update the codes to the newest version
git pull origin master
- Add or edit your file
- Commit your new file
git add your-file git commit -m 'log'
- Push your change to remote repository
git push origin master
- Here is a sample to generate a patch
git status view /home/usr/.gitconfig git add src/pulsecore/random.c git log -v git commit -m 'core: Fix variable "has_whined" value bug' git format-patch -s -1 view 0001-core-Fix-variable-has_whined-value-bug.patch
ubuntu qq for linux自动关闭的问题解决方法
ubuntu 10.04还是存在这个问题 哎
下面解决的办法:
1. 在终端输入命令代码:sudo vim /usr/bin/qq
2. 在打开的qq配置文件中,在#!bin/sh下面一行,cd /usr/share/tencent/qq/前面一行的位置插入代码:
export GDK_NATIVE_WINDOWS=true
3. 最终修改后的QQ脚本配置文件如下,保存关闭即可。
#!/bin/sh
export GDK_NATIVE_WINDOWS=true
cd /usr/share/tencent/qq/
./qq
export GDK_NATIVE_WINDOWS=true
cd /usr/share/tencent/qq/
4. 重启QQ,qq不再自动退出和关闭了。
Subscribe to:
Posts (Atom)