Archive for September, 2015

Update Gandi Modules

A couple of my Gandi servers refused to restart the firewall due to missing modules (modules didn’t match the kernel version).
Here is a list of commands to rectify this problem.

Update modules:

  • Change directory to root: cd /
  • Download the modules’ archive: wget http://mirrors.gandi.net/kernel/$(uname -r)-modules.tar.gz
  • Move the existing modules: mv -f /lib/modules/$(uname -r) /lib/modules/$(uname -r).old
  • Uncompress the archive: tar xzf $(uname -r)-modules.tar.gz
  • Then: depmod $(uname -r)
  • You can list loaded modules: lsmod
  • You can check all the previous version of kernel for your server here.

Referenced from here: http://wiki.gandi.net/en/iaas/references/server/kernel_modules?s[]=modules

How to share content to Twitter and LinkedIn

Here are some examples I crafted today for EWEA 2015 registration:

Twitter

https://twitter.com/intent/tweet?text=I've just registered for EWEA 2015! Have you? :-) %0A&url=http://www.ewea.org/annual2015/information/&hashtags=EWEA2015&via=EWEA2015Annual

Gives:
Twitter-share

LinkedIn

http://www.linkedin.com/shareArticle?mini=true&url=http://www.ewea.org/annual2015/registration/&summary=I've just registered for EWEA 2015! Have you? :-)

Gives:
LinkedIn-Share

Reference:
https://dev.twitter.com/web/tweet-button
https://developer.linkedin.com/docs/share-on-linkedin

Adding a line-break in a Twitter share

So sometimes you want to format your Twitter share by adding a line break.
You can with the unicode string: %0A

e.g. https://twitter.com/intent/tweet?text=I%27ve%20just%20registered%20for%20EWEA%202015!%20You%20should%20too!%0A&url=http://www.ewea.org/annual2015/registration/&hashtags=EWEA2015

Will result in:

Twitter-share-line-break

Redirecting an old domain name to a web page

I needed to redirect globalwindday.org to www.ewea.org/globalwindday

A normal Apache redirect did not work.

For example:
globalwindday.org/faq would redirect to www.ewea.org/globalwindday/faq
This was a page that did not exist so therefore resulted in a 404 error.

Here are the lines added to vhosts.conf to make it work (stripping sub pages):

<VirtualHost *:80>
        ServerName  globalwindday.org
        ServerAlias www.globalwindday.org
        # Redirect permanent / http://www.ewea.org/globalwindday/   <-- This did not work
        RewriteEngine On
        RewriteCond %{HTTP_HOST} globalwindday.org [NC]
        RewriteRule ^(.*)$  http://www.ewea.org/globalwindday/ [R=301,NC]
</VirtualHost>

 

As constructed from this reference page:
https://gist.github.com/ScottPhillips/1721489