跳至主要内容

博文

目前显示的是标签为“ubuntu”的博文

rsync exclude some folder or file

example: rsync -avt /home/workspace/symfony2.1_bannieres /home/local_workspace/admin --delete --exclude-from '/home/local_workspace/exclude_admin.txt' suppose we have a exclude file in /home/local_workspace/exclude_admin.txt, and his content is : app/logs app/cache .svn .git this is the article: http://articles.slicehost.com/2007/10/10/rsync-exclude-files-and-folders

awstats

normally installed awstats in ubuntu has a folder in /usr/share/doc/awstats This folder contains the awstats_updateall.pl, which can trigger all the update for all config file in the specific path. So we should not remove these folder from doc. you can bind the awstats by cron.d or logroate , see this example in /etc/logrotate.d/apache2 : prerotate /usr/share/doc/awstats/examples/awstats_updateall.pl -configdir=/etc/awstats -awstatsprog=/usr/lib/cgi-bin/awstats.pl now endscript Sure, here is an good explaination for this topic: http://www.dalouche.com/wordpress/2006/11/22/howto-apache2-awstats-setup-on-debianubuntu-edgy-eft/ normally, we should do both of them, use cron.d and attach it with logrotate, cause logrotate will disable our awstats

recursively set diretory or file privileges.

To recursively give  directories  read&execute privileges: find /path/to/base/dir -type d -exec chmod 755 {} + To recursively give  files  read privileges: find /path/to/base/dir -type f -exec chmod 644 {} + Or, if there are many objects to process: chmod 755 $(find /path/to/base/dir -type d) chmod 644 $(find /path/to/base/dir -type f) Or, to reduce  chmod  spawning: find /path/to/base/dir -type d -print0 | xargs -0 chmod 755 find /path/to/base/dir -type f -print0 | xargs -0 chmod 644

ubuntu install redmine

after the installation of redmine, it is always very slow. redmin 2.1 this modification can solve the problem. http://www.redmine.org/projects/redmine/wiki/HowTo_configure_Apache_to_run_Redmine this is an aticle for older version of redmine. simply do this after the installation:(suppose you install in /opt/redmine-2.1/) cp configuration.yml.example configuration.yml vi /etc/apache2/site-enable/redmine add :         RailsEnv production         RailsBaseURI /redmine normally this works. There is another article talk about this: http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_in_Ubuntu My own configuration is : /etc/apache2/sites-enabled/redmine #the two parameter is for private server and do not close the idle process to get a more quick response. PassengerPoolIdleTime 0 PassengerMaxPreloaderIdleTime 0 DocumentRoot "/opt/redmine-2.1/public" ServerName redmine.addepi.fr ServerAdmi...

ubuntu mount error

How to Resolve “mount error(12): Cannot allocate memory” on a Windows Share October 18th, 2010   | Tags:  CIFS ,  Linux ,  Samba ,  Ubuntu ,  Windows If you mount a Windows 7 share using Samba/CIFS you may run into “mount error(12): Cannot allocate memory” if you are using very large files on the Windows machine. Looks like in certain situations Windows needs to be told to run as a file server and to expect large files. You can read more details at  Large Files are locking up Windows 7 32 bit and 64 bit , but the solution is to make two registry edits and then restart a service: Set “HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\LargeSystemCache” to “1″. Set “HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters\Size” to “3″. Restart the “server” service. Once you have done that you should be able to mount the share using a command like “sudo mount -a” or just reboot the Linux machine. form...

ovh server, resize or remove & create partion for boot/logic

This is article for how to make a raid /check them. https://help.ubuntu.com/community/Installation/SoftwareRAID This is an official tutorial.  http://webapp5.rrz.uni-hamburg.de/SuSe-Dokumentation/manual/sles-manuals_en/manual/raidresize.html   This tell us how to grow or shrink a raid partition. http://blog.thecodingmachine.com/fr/content/redimensionner-les-partitions-dun-serveur-ovh-kimsufi this is how to do it if you are not a raid partition for ovh. In fact , they all forget one thing, if you are resizing your boot partition, if you have removed the device and recreate it. your UUID is changed, so you need to update the grub. this article tells us how to reinstall a debian by OVH rescue, and talk about how to correctly update the grub. http://marek.niesiobedzki.pl/2010/02/22/debian-5-from-scratch-rescue-ovh-grub/ The most important thing for update grub after you have successfully resize or remove or recreate your partition is: mount -obind /dev /mnt/...

git problem

if you get this: remote: error: refusing to update checked out branch: refs/heads/master remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD. remote: error: remote: error: You can set 'receive.denyCurrentBranch' configuration variable to remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into remote: error: its current branch; however, this is not recommended unless you remote: error: arranged to update its work tree to match what you pushed in some remote: error: other way. remote: error: remote: error: To squelch this message and still keep the default behaviour, set remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'. well , if found the p...

install git server

all the precedure is written in this article.  http://git-scm.com/book/zh/%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E7%9A%84-Git-%E5%9C%A8%E6%9C%8D%E5%8A%A1%E5%99%A8%E4%B8%8A%E9%83%A8%E7%BD%B2-Git  但是我却碰到了一个很奇怪的问题,就是无论如何也clone不了新建的项目:  fatal: protocol error: bad line length character: fatal: The remote end hung up unexpectedly  有人说可以看一下这个命令的输出: ssh mathieu@192.168.1.52 git-receive-pack /var/www/gitproject.git 然后我就看了: This is BASH 4.2 - DISPLAY on :0.0 Thu Mar 21 15:44:29 CET 2013 00760000000000000000000000000000000000000000 capabilities^{} report-status delete-refs side-band-64k quiet ofs-delta 看起来最后一行好像是git的输出,而且没有错。那前面三行是什么东西?这段话好像每次ssh都会给我,于是去看了一眼.barshrc # Looks best on a black background..... #echo -e "${CYAN}This is BASH ${RED}${BASH_VERSION%.*}${CYAN} - DISPLAY on ${RED}$DISPLAY${NC}\n" #date #if [ -x /usr/games/fortune ]; then # /usr/games/fortune -s # makes our day a bit more fun.... :-) #fi #function _exit() # function to run upon exit of...

convert png to piled tif (all files in a folder)

for file in /data/admin/web/data/vivastreet/image/50b7814*; do newname=`basename "$file" png`tif; convert $file -define tiff:tile-geometry=256x256 -compress jpeg "ptif:/mnt/data/vivastreet/$newname"; done well, this will rename the *.png to *.tif and convert them . further more, if you wann only list 100 file in a folder: ls | head -n 100 if you wanna to remove them: ls | head -n 100 | xargs rm

install a web based linux admin interface webmin

this article is a memo for the installation of webmin and his plugin, vitual sever. ubuntu 12.04 lts is really simple, just download his deb distribution by : cd /tmp wget http://prdownloads.sourceforge.net/webadmin/webmin_1.620_all.deb dpkg --install webmin_1.620_all.deb if have some package problem, just do: apt-get install perl libnet-ssleay-perl openssl libauthen-pam-perl libpam-runtime libio-pty-perl apt-show-versions python for sure. you can read this ; http://www.webmin.com/deb.html then vitual min: cd /tmp wget http://software.virtualmin.com/gpl/scripts/install.sh chmod 775 install.sh ./install.sh and then yes ,yes,yes. 最后有个问题: /etc/apache2/apache2.conf 里面没有包含 NameVirtualHost *:80 但是没有它我原来的vhost在ubuntu 从12.04升级到12.10以后就都不行了, 还有就是必须先stop webmin, 重新启动apache2, 然后再启动webmin,所有的vhost都ok了。

怎样更改ovh reverse du serveur dédié

主要根据这篇文章, https://admin-serv.net/blog/141/changer-le-reverse-de-son-dedie/ 更改 reverse name: grep -rin ns2301914 ./* 输出: grep: ./blkid.tab: No such file or directory ./hostname:1:ns2301914.ovh.net ./hosts:4:5.135.137.158         ns2301914.ovh.net       ns2301914 ./hosts:5:2001:41D0:8:CA9e::1   ns2301914.ovh.net       ns2301914 ./issue:2:Linux ns2301914.ovh.net 3.2.13-grsec-xxxx-grs-ipv6-64 #1 SMP Thu Mar 29 09:48:59 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux ./issue:6:hostname  : ns2301914.ovh.net ./mailname:1:ns2301914.ovh.net ./motd:7:hostname  : ns2301914.ovh.net 更改所有的这些文件,把ns2301914.ovh.net 改成 spoop.ovh.net hostname spoop.ovh.net rndc flush /etc/init.d/bind9 restart 有一点需要注意: Vous devez tout d'abord avoir un champ A pointant vers l'adresse IP du dédié en question. Si vous en avez la possibilité chez votre hébergeur, créé aussi une  Glue   (chez Gandi, "Glue Records", chez OVH "GLUE Re...

安装新server

apt-get install mysql-server mysql-client apt-get install apache2-mpm-worker apt-get install libapache2-mod-fastcgi php5-fpm php5 a2enmod actions fastcgi alias ===if this file  do not exist, create it. ==== vi /etc/apache2/conf.d/php5-fpm.conf copy :                         AddHandler php5-fcgi .php                 Action php5-fcgi /php5-fcgi                 Alias /php5-fcgi /usr/lib/cgi-bin/php5-fcgi                 FastCgiExternalServer /usr/lib/cgi-bin/php5-fcgi -socket /var/run/php5-fpm.sock -pass-header Authorization         in it. cd /tmp wget http://sourceforge.net/projects/phpmyadmin/files/phpMyAdmin/4.0.0-alpha2/phpMyAdmin-4.0.0-alpha2-all-languages.tar.gz/download#  tar xvf download rm download mv phpMyAdmin-4.0.0-alpha2-all-la...

在ovh 上装 nfs server

ovh自己的kernal build 和nfs 不兼容,有人如此说; Donc en fait c'est un problème sur Ubuntu (et peut être d'autres) entre le script de démarrage du serveur NFS et le kernel OVH. Il faut donc faire une modif du script de démarrage : Code: nano +67 /etc/init.d/nfs-kernel-server Commenter cette ligne: Code: if [ -f /proc/kallsyms ] && ! grep -qE ' nfsd_serv ' /proc/kallsyms; then Et la remplacer par: Code: if [ -f /proc/kallsyms ] && ! grep -qE 'init_nf(sd| )' /proc/kallsyms; then Après faire un Code: /etc/init.d/nfs-kernel-server/start 还有就是重装kernal: 详见: http://limeskystudios.com/articles/mise-en-place-dun-serveur-nfs-ubuntu 安装nfs server 请见: https://help.ubuntu.com/community/SettingUpNFSHowTo

install backup pc ubuntu

sudo apt-get install backuppc =>save the user name and password. then you set up the config by cgi: http://backup-server/backuppc/ if your appache is started correctly. if backup linux, we use rsync for ssh tunnel. We need to setup a ssh tunnel to establish the connection. So it's a common exchange public key process. see this; http://backuppc.sourceforge.net/faq/ssh.html also, backup pc suggest to use mod_perl for apache. Which will greatly increase the execution speed.

move in vim

e Move to the end of a word. w Move forward to the beginning of a word. 3w Move forward three words. b Move backward to the beginning of a word. 3b Move backward three words. $ Move to the end of the line. 0 Move to the beginning of the line.  ^ Move to the first non-blank character of the line. ) Jump forward one sentence.  ( Jump backward one sentence. } Jump forward one paragraph. { Jump backward one paragraph. H Jump to the top of the screen. M Jump to the middle of the screen. L Jump to the bottom of the screen. 10 or 10 Move 10 pages up.  5 or 5 Move 5 pages down.  G Jump to end of file.  1G Jump to beginning of file (same as gg).  50G Jump to line 50.  'm Jump to the beginning of the line of mark m.  `m Jump to the cursor position of mark m.  '' Return to the line where the cursor was before the latest jump.  (Two single quotes.) `` Return to the cursor position before the latest jump...