How to create a .db file in Python with sqlite3?Actually It’s really easy.
Run the following code
1 2 |
|
After running the above code,the test.db file will be created if it does not exist.
Of course,you have the proper permission to create the file.
How to create a .db file in Python with sqlite3?Actually It’s really easy.
Run the following code
1 2 |
|
After running the above code,the test.db file will be created if it does not exist.
Of course,you have the proper permission to create the file.
I was once stucked in installing build-essentials which is for Debian/Ubuntu.I could not find any packages like build-essentials in yum.However this helped me out.
1
|
|
I have been getting well on with my java tool.However When I use the javac command.It says
1
|
|
It’s just because I just only install the JRE(Java Runtime Environment) and do not install JDK(Java Development KIt).I got the answer going for my fedora
1
|
|
To Start
1
|
|
To Stop
1
|
|
To Restart
1
|
|
I have often suffered this painful thing.When I start a service but the destination port is always used.So I should list all open ports and kill the occupied application.
So This is a short tip for how to list open ports on Linux
1
|
|
Note sometimes you should grant the command for a enough access.
For a better understanding,please
1
|
|
or navigate to http://linux.about.com/od/commands/l/blcmdl8_netstat.htm
For Mac Users
1
|
|
How to known what Linux Distribution I am using now.
All right, run this command and you could get what you need in from the output result
1 2 3 4 5 6 7 8 9 10 11 |
|
This happends when I am dealing with VirtualBox.
Try this
1
|
|
This works for me.
1 2 |
|
Let’s make it direct.
1
|
|
It’s easy to remove a certain remote branch in a Git respository. You could try this
1
|
|
And of course another short command is waiting for You
1
|
|
Yum is a great tool for manage dependencies and easy to use.However actually there is a way to speed up the installation.
Fastestmirror is a tool that will help yum determin what mirror is fastest and to use.
To install on Fedora 17
1
|
|
Of course you could customize the fastestmirror configuration easily
1
|
|
So when you next install a package from the network,I hope you could feel it much faster.
I once had a request to sum the number of files in a specific folder.After googling I found the command wc could help me out.
wc – print newline, word, and byte counts for each file. And I think wc is short for Word Count.Please have a detailed information by visiting http://linux.about.com/library/cmd/blcmdl1_wc.htm if you have the desire.
Ok,Let’ get the total number of files(including folders) in a specific folder
1
|
|
Well,the following command will sum the number of pure files(Not including folders)
1
|
|
However how to sum the number of pure folder?The following command will help.
1
|
|
Git-daemon is A really simple server for git repositories.You can take a detailed understanding by reading https://www.kernel.org/pub/software/scm/git/docs/git-daemon.html .
I once often used git-daemon when I was using Ubuntu.But when I turn to Fedora and found it was not installed.And the output is like the following.
1
|
|
So I write this post to record How to install and enable git-daemon First Let’s intall the git Daemon:
1
|
|
However git daemon is off by default.We should enable it.We should do as the following.
1
|
|
And modify the file as the following configuration.
# default: off
# description: The git dæmon allows git repositories to be exported using \
# the git:// protocol.
service git
{
disable = no
socket_type = stream
wait = no
user = nobody
server = /usr/libexec/git-core/git-daemon
server_args = --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose
log_on_failure += USERID
# xinetd does not enable IPv6 by default
flags = IPv6
}
And then,We use this command to start the git Daemon
1
|
|
Mostly we could clone the repositories from the git daemon.
But if you have enabled Firewall and other people want to clone the repository from your git daemon,please let the port 9418 available to the outsite.
Is there any way to append output(debugging information) to a existings file? As we all know in bash the command ‘>’ will write ouputs to a file.However this command will also erase the existing data it the file.
Of course bash provides a command that appends outputs to a file.It resembles ‘>’.It’s ‘>>’
The following is a piece of example code.
1 2 3 4 5 6 7 8 |
|
1 2 3 4 |
|
1 2 3 4 5 6 |
|
1
|
|
1
|
|
Actually I am fresh to Write Blog with Octopress in Github Pages.According to the Introduction .And now I have make it avaible and the website is present. However I have suffered some problems when I did the setup.Here is a summary of what I have sufferd and how I resolved.
bundle install
to install missing gems.source ~/.rvm/scripts/rvm
rvm use 1.9.3 --default
rake preview
,But I got 404 when I open the http://127.0.0.1:4000[androidyue@androidyue octopress]$ rake preview
Starting to watch source with Jekyll and Compass. Starting Rack on port 4000
[2013-09-07 15:46:20] INFO WEBrick 1.3.1
[2013-09-07 15:46:20] INFO ruby 1.9.3 (2013-06-27) [i686-linux]
[2013-09-07 15:46:20] INFO WEBrick::HTTPServer#start: pid=10490 port=4000
Configuration from /home/androidyue/github/octopress/_config.yml
Auto-regenerating enabled: source -> public/
[2013-09-07 15:46:21] regeneration: 95 files changed
>>> Change detected at 15:46:21 to: screen.scss
create public/github/stylesheets/screen.css
Errno::ENOENT on line ["56"] of /home/androidyue/.rvm/gems/ruby-1.9.3-p448/gems/compass-0.12.2/lib/compass/actions.rb: No such file or directory - /home/androidyue/github/octopress/public/github/stylesheets/screen.css
Run with --trace to see the full backtrace]
As the above information and all the sources are outputed in public/ folder And the following are a part of my _config.yml file
# If publishing to a subdirectory as in http://site.com/project set 'root: /project'
root: /
permalink: /blog/:year/:month/:day/:title/
source: source
destination: public/
plugins: plugins
code_dir: downloads/code
category_dir: blog/categories
So compare the two piece information and check the output dir and is public or a subdirectory in public folder.If your outputdir is a subdirectory you should use this link http://127.0.0.1:4000/yourSubDirName P.S.This is the help from StackOverflow http://stackoverflow.com/questions/17465404/rake-preview-not-working-in-octopress
I will keep record about this topic becuase I am making friends with Octopress in Github Pages
echo "Hello World";
1 2 |
|
1
|
|
1 2 |
|