1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Wednesday, June 30, 2010

“Tinyurl”-ify DropBox Public Links With .htaccess

http://ubuntu-tutorials.com/tag/dropbox/
November 8th, 2008

I just recently started using DropBox on Ubuntu 8.10 "Intrepid Ibex" and leftyfb in IRC pointed out to me a nifty little trick with .htaccess files. If you've been using DropBox I'm sure you've seen or made use of the Public folder and sharing files. You may have also noticed that the DropBox Public links are long and likely hard to remember when needed.

One thing that you can do, if you have your own web server, is dynamically generate these public links. For example:

Original DropBox Public URL:

http://dl.getdropbox.com/u/312414/Christer_Edwards.asc

DropBox Public URL with .htaccess trick:

http://zelut.org/dropbox/Christer_Edwards.asc

In order to accomplish this you'll need access to a webserver and the ability to create and use a .htaccess file. On my webserver I created a folder called "dropbox" and then pasted the following into a new file, .htaccess:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ http://dl.getdropbox.com/u/012345/$1 [L,QSA]

You will need to replace the "012345″ with your unique ID. As you notice from the original link above, my unique ID is "312414″. You can find yours by copying the public link within Nautilus.

Once this is done you can share files by placing them into your DropBox Public folder and then appending the filename to your webserver URL + created folder. Again, since I created the folder "dropbox" on http://zelut.org/, my url is http://zelut.org/dropbox/. I simply append the filename I want to share and its done!

If anyone can suggest a way to present this URL with an index.html that may be a cool trick.

Relaying Postfix SMTP via smtp.gmail.com

http://ubuntu-tutorials.com/2008/11/11/relaying-postfix-smtp-via-smtpgmailcom/
November 11th, 2008
( With little changes these steps worked on PigBookVMu, a Ubuntu 10.04 in VMware workstation, HL 20100630)

I've got a few servers in different places around the country and try to monitor them using the logwatch utility. One problem that I've run into however is that a few of these servers are not able to send their logwatch emails to me, based on email restrictions by the ISPs. I spent some time this afternoon researching what was required to have my servers authenticate to my gmail account and send me the mail that way. This setup assumes Ubuntu 8.04 (or later) and Postfix.

Install the required packages

sudo aptitude install postfix libsasl2 ca-certificate libsasl2-modules

On Ubuntu 10.04 (HL)

aptitude install postfix libsasl2-2 sasl2-bin libsasl2-modules procmail

Configure Postfix

This tutorial will not outline how to configure your postfix server, but we'll jump directly to the relayhost section. You'll want to add the following lines to your /etc/postfix/main.cf file:

relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtp_use_tls = yes

The above lines are telling Postfix that you want to relay mail through gmail on a specific port, telling it to authenticate, and where to find the username and password. The last three lines specify the authentication types supported, where the certificate authority file is and that it should use tls.

Define Username and Password

Next we'll need to populate the sasl_passwd file. Create the file /etc/postfix/sasl_passwd with the following contents:

[smtp.gmail.com]:587 user.name@gmail.com:password

This file should have restrictive permissions and then needs to be translated into a .db that Postfix will read.

sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd

At this point you can restart Postfix and it should work, however it will complain about not being able to authenticate the certificate. To take care of this issue we'll use the ca-certificate package we installed and tell it where it can validate the certificate.

cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

Go ahead and reload postfix (sudo /etc/init.d/postfix reload) and you should be set.

If this article has been helpful, please consider linking to it.

Mutt Quick Reference Chart

http://www.ucolick.org/~lharden/muttchart.html

This is a chart of common Mutt commands, the context(s) in which you could use them, what they do, the section(s) of the tutorial that explain them, and which .muttrc settings affect them.

Note: some commands may appear more than once if their effects differ depending on context.

Mutt CommandContextEffectTutorial SectionRelevant .muttrc settings
aSending Message Attaches a file to the message you have createdSending Messagesnone
bSending MessageLets you edit the list of blind carbon copy recipients for the message you have created Sending Messagesnone
cSending MessageLets you edit the list of carbon copy recipients for the message you have createdSending Messages none
dMain Menu, Reading MessageMarks the current message for deletionDeleting Messagesnone
fMain Menu, Reading Message Forwards the message to another addressForwarding Messagesaskbcc, askcc, edit_headers, editor
iReading MessageReturns from reading a message to the Main Menu Reading Messagesnone
jMain MenuChanges the selected message to the next messageGetting Around in the Menu color
kMain MenuChanges the selected message to the previous messageGetting Around in the Menucolor
mMain Menu, Reading Message Creates a new message to sendSending Messagesabort_nosubject, abort_unmodified, askbcc, askcc, edit_headers, editor, recall
muttCommand line Starts muttGetting Into and Out of the Mutt Menubeep-new, color, mark_old, move, sort
pMain Menu, Reading MessagePrints the currently selected message Printing Messagesprint, print_command
qMain MenuQuits muttGetting Into and Out of the Mutt Menu delete, mark_old, mbox, move
qSending MessageAborts or postpones the message you have createdSending Messages orPostponing Messages postpone, postponed
rMain Menu, Reading MessageCreates a reply to the current messageReplying to Messagesabort_nosubject, abort_unmodified, askbcc, askcc, edit_headers, editor, include, metoo
sMain Menu, Reading MessageSaves the current message to a fileSaving Messagesfolder
sSending MessageLets you change the subject for the message you have created Sending Messagesnone
tSending MessageLets you edit the list of recipients for the message you have createdSending Messages none
uMain Menu, Reading Message (messages marked for deletion only)Removes the deletion mark from the current messageDeleting Messages none
xHelp MenuReturns from the help menu to the Main MenuGetting Around in the Menunone
ySending Message Sends the message you have createdSending Messagesabort_unmodified, copy, record
?Main MenuGoes from the Main Menu to the Help Menu Getting Around in the Menucolor
-Reading MessageMoves to the previous page in the message you are readingReading Messages none
/Main MenuPrompts for a pattern to search for in the headers of your messagesGetting Around in the Menunone
=Main MenuSelects the first messageGetting Around in the Menucolor, sort
$Main MenuDeletes all messages selected for deletion, and checks for new messages Deleting Messagesbeep_new, delete, mark_old, mbox, move
*Main MenuSelects the last messageGetting Around in the Menu color, sort
< number >Main MenuSelects message < number >Getting Around in the Menucolor
< Enter > Main MenuBrings the currently selected message up on the screenReading Messagescolor
< Space >Reading MessageMoves to the next page in the message you are reading, or to the first page of the next message not marked for deletion Reading Messagesnone
< Tab >Main MenuSelects the next new messageGetting Around in the Menu color
< Esc > /Main MenuPrompts for a pattern to search for in the bodies of your messagesGetting Around in the Menunone
up/down arrowMain MenuChanges the selected message to the previous/next messageGetting Around in the Menucolor
PageUp/PageDown Main Menu, Reading MessageMoves up/down one page in the Main Menu or the message you are readingGetting Around in the Menu or Reading Messages none

Explanation of Chart Columns

  1. Mutt Command is a command you type in, either at your shell prompt or while mutt is running.
  2. Context is the circumstances under which you would use this command. The contexts are:
    • Command line. This is your shell prompt, with mutt not running.
    • Main Menu. This is the main Mutt menu, in which you will see a list of your messages.
    • Help Menu. This is Mutt's online help menu.
    • Reading Message. This is when you are reading a message.
    • Sending Message. This is when you have finished editing a message, and are preparing to send it.
  3. Effect gives a brief explanation of what this command will do. See the tutorial for more details on commands.
  4. Tutorial Section is the section in the tutorial "Learning Mutt" with an explanation of this command.
  5. Relevant .muttrc settings lists the .muttrc settings that will affect the behaviour of this command.

Tuesday, June 29, 2010

How Many Servers They Have?

http://www.downloadsquad.com/2010/06/29/facebook-doubles-its-server-count-from-30-000-to-60-000-in-just-6-months/

Facebook might
vie with Google for the largest website in the world, but let's be honest: Facebook serves pictures and text. It's hardly intensive work. Check out another great article from Data Center Knowledge for some numbers -- or read my bullets:
  • Facebook, with 60,000 servers is big, but not that big
  • Google had, it is speculated, 450,000 servers in 2006 -- God knows how many they have today. Over a million?
  • Microsoft and Intel are probably in second place, with between 100 and 500 thousand servers. Microsoft is probably reaching a similar number to Google with the launch of its newAzure cloud processing service. Amazon likely has a similar number of servers too, but it's impossible to put an exact figure on it -- it depends just how big S3 is today!
  • After the big corporations come the big resellers -- GoDaddy, Rackspace, The Planet, 1&1 Internet, all with 50,000 or more servers.
With Facebook moving into search, and with other neat ideas no doubt up its big blue sleeve, I'm sure that upwards trend will continue until they have one of the biggest installations in the world.

Monday, June 28, 2010

Alibaba.com continues push to take over global ecommerce

http://www.edlconsulting.com/newsdetail.php?id=860&headline=Alibaba.com_continues_push_to_take_over_global_ecommerce

Updated: 2010-06-25

Alibaba.com, a global leader in ecommerce solutions for small- and medium-sized businesses recently annouced the acquisition of Vendio, an ecommerce solutions provider allowing SMBs to manage sales across multiple platforms.

With the purchase, Alibaba gains an additional 80,000 customers as it looks to expand its appeal as a global leader in SMB ecommerce. Current Alibaba customers can now implement Vendio solutions into their ecommerce operations. Among the most successful features of Vendo solutions are mobile storefronts and payment methods allowing for multiple currencies. For SMBs, these are invaluable items known to expand business and encourage growth.

"At Alibaba.com, our goal is to make it easier for our customers around the world to do business by providing solutions that increase margins, productivity and competitiveness through ecommerce," David Wei, chief executive officer of Alibaba.com, said. "We continue to look for synergies and investment opportunities to grow our customer base, acquire additional technology and add new applications that will help our customer base grow and prosper."

SMBs that fail to leverage the growth of ecommerce solutions will likely struggle to compete with their competitors. According to Forrester Research, ecommerce will become a $250-billion-per-year industry by 2015. ADNFCR-2178-ID-19858465-ADNFCR

Sunday, June 27, 2010

虚拟主机安装Dropbox备份网站的教程

http://www.williamlong.info/archives/2222.html-月光博客

  虽然目前从国内访问Dropbox有小小困难,但是从国外访问还是正常的,对于拥有国外Linux虚拟主机的用户,可能会遇到这样的需求,就是如何将国外虚拟主机上的网站备份到Dropbox上,下面我以Dreamhost为例介绍一下备份的方法。

  你需要有一个国外的虚拟主机,虚拟主机需要有SSH权限,并能访问外网,符合这样条件的虚拟主机有一些,例如Dreamhost这类主机。

  使用SSH帐号登录到你的主机地址,之后执行下面的命令:

wget -O dropbox.tar.gz http://www.dropbox.com/download/?plat=lnx.x86

  下载完成文件后,接着,你可以执行下面的命令将其解压缩:

tar -zxof dropbox.tar.gz

  接着执行下面的命令将Dropbox程序转移到~目录。

mv .dropbox-dist ~

  现在,执行下面的程序即可后台运行Dropbox

~/.dropbox-dist/dropboxd &

  第一次执行这个程序的时候,dropboxd会显示一串很长的URL地址,你需要手动在浏览器中执行这个地址,才能将虚拟主机服务器连接到Dropbox,执行完后,Dropbox的Events中会显示"The computer xxx was linked to your account",表明该服务器已经连接好。

  这时候,你的根目录下会出现一个Dropbox目录,并会自动下载,你可以使用下面命令进入你的Dropbox目录

cd ~/Dropbox

  接着,将你的网站目录通过cp -r命令复制到~/Dropbox目录下,就能实现网站的同步备份了。

  如果你想停止运行Dropbox,可以通过下面的命令实现:

killall dropbox

  对于Dreamhost用户来说,其实你一退出SSH,dropbox就会自动退出,你要想让dropbox一直运行,估计要购买价格更高的VPS才行,或者就是用一个程序自动挂着SSH也行。

  最后赞一下Dropbox的速度,在国外的主机上执行Dropbox真快的吓人,几个G的文件,不到半个小时就全部下载更新完毕,这和国内完全不是一个速度啊,我昨天在国内同步几个G的文件,至少要花整整两天的时间。

  参考文章:How To Install Dropbox In An Entirely Text Based Linux Environment

Friday, June 25, 2010

Chinese ecommerce comes to US

http://www.theregister.co.uk/2010/06/25/alibab_ecommerce/

Linking suppliers and sellers

Free whitepaper – A Smart Path to Virtualization

Chinese small business trading site Alibaba has made its first US acquistion - buying Vendio Services which provides eBay listing tools, ecommerce and online selling platforms for small firms.

Alibaba, and AliExpress.com, is a massive database of potential suppliers. Now Vendio's 80,000 small business customers will soon have easy access to Chinese suppliers.

The idea is that Vendio customers will be able to source supplies from AliExpress then use Vendio services to

flog the stuff on eBay, other ecommerce sites or even their own sites.

David Wei, chief executive of Alibaba.com, said the deal would make it easier for its customers to do business around the world. He also said the company was still looking for other possible purchases to grow its customer base and add technology.

Wie said: "The connection of Vendio with Alibaba.com will completely integrate the e-commerce value chain between the B2B and B2C platforms, fully realizing the B2B2C model. I am confident that our complementary businesses will create enhanced opportunities for our customers."

Financial terms were not released but Alibaba did say the deal was part of a $100m investment in AliExpress this year. ®

Thursday, June 24, 2010

Setting up ubuntu 10.04 (Lucid) server with squid 3 as a Transparent Proxy

http://www.ubuntugeek.com/setting-up-ubuntu-10-04-lucid-server-with-squid-3-as-a-transparent-proxy.html
June 22, 2010 · Server · Email This Post

Squid is a caching proxy for the Web supporting HTTP, HTTPS, FTP, and more. It reduces bandwidth and improves response times by caching and reusing frequently-requested web pages. Squid has extensive access controls and makes a great server accelerator. It runs on most available operating systems, including Windows and is licensed under the GNU GPL.
Thanks to Jayson for this guide

Complete Steps in Setting up UBUNTU Server 10 with SQUID 3 as a Transparent Proxy.

Step 1. Install the Ubuntu Server 10, include LAMP if you want

Step 2. Change the network interfaces from dhcp to static

sudo nano /etc/network/interfaces

auto eth0
iface eth0 inet static
address 192.168.1.250
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.88

post-up iptables-restore < /etc/iptables.up.rules

auto eth1
iface eth1 inet static
address 192.168.2.1
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255

Step 3. Install Web Admin (webmin) (Optional)

wget http://prdownloads.sourceforge.net/webadmin/webmin_1.510-2_all.deb
dpkg –install webmin_1.510-2_all.deb
sudo apt-get -f install

https://localhost-IP ADDRES:10000

*Note Make sure you give permission to the IPTABLES ruleset to for you to access webmin over the net.

Step 4. Install ClamAV and ClamAV-freshclam

sudo apt-get install clamav clamav-freshclam

Step 5. The first step is to install squid 3

sudo apt-get install squid3

edit the squid 3 configuration file in your favorite editor

sudo nano /etc/squid3/squid.conf

and set the transparency and the allowed hosts

http_port 3128 transparent
acl our_networks src 192.168.2.0/24
acl localnet src 127.0.0.1/255.255.255.255
http_access allow our_networks
http_access allow localnet

where 192.168.2.0/24 is the IP range of local network. Probably you need to adjust the swap size

cache_dir ufs /var/spool/squid3 7000 16 256

here the first number denotes the size of cache in megabytes. Save you changes and restart the squid proxy by

sudo /etc/init.d/squid3 restart

Step 6. Edit the /etc/sysctl.conf

sudo nano /etc/sysctl.conf

Uncomment the line that enable packet forwarding for IPv4 and IPv6

Net.ipv4.ip_forward = 1
Net.ipv6.conf.all.forwarding = 1

Step 7. Edit the IPTABLE ruleset of NAT and FILTER

sudo nano /etc/iptables.up.rules

*nat

-A PREROUTING –i eth1 –p tcp –m tcp –dport 80 –j DNAT –to-destination 192.168.2.1:3128
-A PREROUTING –i eth1 –p tcp –m tcp –dport 80 –j REDIRECT –to-ports 3128
-A POSTROUTING –s 192.168.2.0/24 –o eth0 –j MASQUERADE

*filter

-A INPUT –i lo –j ACCEPT
-A INPUT –m state –i eth0 –state REALATED,ESTABLISHED –j ACCEPT
-A INPUT eth1 –j ACCEPT
-A INPUT –p tcp –m tcp –dport 22 –j ACCEPT # permit ssh using putty
-A INPUT –p tcp –m tcp –dport 10000 –j ACCEPT # permit webmin access
-A INPUT –j LOG
-A INPUT –j DROP
-A FORWARD –i eth1 –j ACCEPT
-A OUTPUT –o lo –j ACCEPT
-A OUTPUT –o eth1 –j ACCEPT
-A FOWARD –o eth1 –j ACCEPT
-A FORWARD –s 192.168.2.0/24 –o eth0 –j ACCEPT
-A FORWARD –d 192.168.2.0/24 –m state –state ESTABLISHED,REALTED –I eth0 –j ACCEPT

STEP 8. Edit rc.local

sudo nano /etc/rc.local

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 –o eth0 -j MASQUERADE

Step 9. reboot the server

Step 10. Configure the workstation for static IP Address making the LAN IP of the Ubuntu box as the gateway. Make sure that the IP Address of the work station is within the network you setup.

Tuesday, June 22, 2010

Install Subversion and Subclipse for Eclipse on Ubuntu

http://dimitar.me/install-subversion-and-subclipse-for-eclipse-on-ubuntu/
(I followed these steps on PigU, HL 20100622)

If you do not have Eclipse installed yet, run:

 sudo apt-get install eclipse

Install Subversion

 sudo apt-get install subversion

Install the Subversion plugin for Eclipse

Get the Java bindings for Subversion:

 sudo apt-get install libsvn-java

Now we are ready to install the plugins in Eclipse.

Open Eclipse.

Go to Help -> Install New Software

Then hit the "Add" button.

Put "Subclipse 1.6.x (Eclipse 3.2+)" under Name and "http://subclipse.tigris.org/update_1.6.x" under Location:

Add the libraries for Subclipse

Add the libraries for Subclipse

The above is for Elclips 3.2+ and Subversion 1.6.x.

If you have different Eclipse or Subversion versions, check this list and substitute accordingly:

Name: Subclipse 1.6.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.6.x

Name: Subclipse 1.4.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.4.x

Name: Subclipse 1.2.x (Eclipse 3.2+)
URL: http://subclipse.tigris.org/update_1.2.x

Name: Subclipse 1.0.x (Eclipse 3.0/3.1)
URL: http://subclipse.tigris.org/update_1.0.x

More info about the different versions: http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA

Then hit "OK". You will now be presented with these options:

Subclipse Installation Options

Subclipse Installation Options

If you are unsure what Subclipse component you will need, you can check all of them. Also, keep in mind that you can always go back to this in the future and install/uninstall any of the components as needed.

Then "Next" and "Finish" on the subsequent screens.

After the plugins are installed, it will prompt you to restart Eclipse. Go ahead and do so.

You are not done yet. You need to fix the JavaHL.

Edit the eclipse.ini file:

 sudo vi /usr/lib/eclipse/eclipse.ini

Add the following line under -vmargs:

-Djava.library.path=/usr/lib/jni

Here is what my eclipse.ini file looks like:

 $ cat /usr/lib/eclipse/eclipse.ini -startup plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520 -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -startup --launcher.library -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -startup /usr/lib/eclipse/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar --launcher.library /usr/lib/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520 -vmargs -Djava.library.path=/usr/lib/jni -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=//usr/share/eclipse/dropins -Xms40m -Xmx256m -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=//usr/share/eclipse/dropins

For more info on fixing JavaHL if you need it: http://subclipse.tigris.org/wiki/JavaHL#head-bb1dd50f9ec2f0d8c32246430c00e237d27a04fe

You should be able to use Subversion with Eclipse for your projects at this point.

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...