Distribute Mediaflux libraries to maven using Mediaflux web server








  1. Install the libraries as artifacts to your local maven repository. And it will generate and save the artifacts to $HOME/.m2/repository/com/arcitecta directory
  2. Copy the artifacts from the local repsitory to ${MFLUX_HOME}/www/
    mkdir -p $MFLUX_HOME/www/maven-repository/com/arcitecta
    cp -r $HOME/.m2/repository/com/arcitecta/* $MFLUX_HOME/www/maven-repository/com/arcitecta/
  3. In aterm, run the following command to create a http processor (to link the web directory):
    http.processor.create :app maven-repository :type file :authentication < :domain www-public :user www-public > :url maven-repository :translate maven-repository
    if your mediaflux is configured use https on a non-standard port, you need to specify :encryption-required "true" :encryption-port "8443" e.g. 8443 is the https server port.
  4. You can now include the repository in your maven project's pom.xml or $HOME/.m2/settings.xml:
        <repositories>
    <repository>
    <id>mediaflux-libs</id>
    <name>mediaflux-libs</name>
    <url>https://mediaflux.your-domain.org:8443/maven-repository</url>
    <layout>default</layout>
    </repository>
    </repositories>
  5. Also in your maven project's pom.xml, add the mediaflux libraries/artifacts in dependencies:
        <dependencies>
    <dependency>
    <groupId>com.arcitecta</groupId>
    <artifactId>aplugin</artifactId>
    <version>3.9.011</version>
    </dependency>
    </dependencies>


see also




Include Mediaflux libraries into local maven repository









#!/bin/bash
export MFLUX_HOME=/opt/mflux
export MFLUX_VERSION=3.9.011

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/plugin/lib/aplugin.jar -DgroupId=com.arcitecta -DartifactId=aplugin -Dname=aplugin -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/java/mfclient.jar -DgroupId=com.arcitecta -DartifactId=mfclient -Dname=mfclient -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/gwt/mfclientgwt.jar -DgroupId=com.arcitecta -DartifactId=mfclientgwt -Dname=mfclientgwt -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/gwt/mfclientguigwt.jar -DgroupId=com.arcitecta -DartifactId=mfclientguigwt -Dname=mfclientguigwt -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true


see also




maven: include libraries into you local repository








#!/bin/bash
export MFLUX_HOME=/opt/mflux

export MFLUX_VERSION=3.9.011

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/plugin/lib/aplugin.jar -DgroupId=com.arcitecta -DartifactId=aplugin -Dname=aplugin -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/java/mfclient.jar -DgroupId=com.arcitecta -DartifactId=mfclient -Dname=mfclient -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/gwt/mfclientgwt.jar -DgroupId=com.arcitecta -DartifactId=mfclientgwt -Dname=mfclientgwt -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true

mvn install:install-file -Dfile=${MFLUX_HOME}/dev/client/gwt/mfclientguigwt.jar -DgroupId=com.arcitecta -DartifactId=mfclientguigwt -Dname=mfclientguigwt -Dversion=${MFLUX_VERSION} -Dpackaging=jar -DperformRelease=true -DcreateChecksum=true
After the above step, you can add dependency to your maven project's pom.xml:
    <dependencies>
        <dependency>
            <groupId>com.arcitecta</groupId>
            <artifactId>aplugin</artifactId>
            <version>3.9.011</version>
        </dependency>
    </dependencies>


see also




Configure http proxy for maven








Edit $HOME/.m2/settings.xml file:
vi ~/.m2/settings.xml
<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>proxy.somewhere.com</host>
      <port>8080</port>
      <username>proxyuser</username>
      <password>somepassword</password>
      <nonProxyHosts>www.google.com|*.somewhere.com</nonProxyHosts>
    </proxy>
  </proxies>
</settings>



Dell Outlet Australia

















Dell Outlet Australia











ls: list only files








for f in *; do [[ -d "$f" ]] || echo "$f"; done
find . -maxdepth 1 -type f -printf '%f\n'



Fix permissions after changing MySQL data directory








  • sudo vi /etc/apparmor.d/usr.sbin.mysqld
    /path/to/new_mysql_data_dir/ r,
    /path/to/new_mysql_data_dir/** rwk,
  • sudo chown -R mysql:mysql /path/to/new_mysql_data_dir/
  • sudo /etc/init.d/apparmor restart
    sudo /etc/init.d/mysql restart



PDF viewers on Linux








  1. evince
  2. acroread
  3. xpdf
  4. kpdf
  5. gv
  6. okular
  7. mupdf
    sudo apt-get install mupdf
  8. zathura
    sudo apt-get install zathura
  9. qpdfview
    sudo apt-add-repository ppa:b-eltzner/qpdfview
    sudo apt-get update
    sudo apt-get install qpdfview
  10. foxit



Enum in python








  • Before Python 3.4 (PEP 435),

    class Animal:
    DOG = 1
    CAT = 2

    x = Animal.DOG
    or

    class Animal:
    DOG, CAT = range(2)

    x = Animal.DOG
  • Since Python 3.4 (PEP 435),

    class Animal(Enum):
    DOG = 1
    CAT = 2

    x = Animal.DOG
    or equivalently:

    from enum import Enum

    Animal = Enum('Animal', 'DOG CAT')

    x = Animal.DOG



SSH tricks








  • 9 awesome ssh tricks
  • Use autossh for managing persistent sessions/tunnels which will restart upon network or local issues.
  • OpenSSH >=5.4 will allow you to add new port-forwardings in multiplexing mode. If you start a new slave session with port forward requests they will automatically be relayed and added to the master. You can also request the mux master set up forwards without requesting a new session using
    ssh -O forward -Rxx:yy:zz -Laa:bb:cc user@host
  • Rather than grovelling though /tmp to find a working agent (which could connect you to a malicious one!), you might instead want to start the agent at a known location (e.g. ~/.ssh/auth_sock) using
    ssh-agent -a /path/to/socket
  • sshuttle - transparent proxy server that forwards over ssh, now you can have a full-featured vpn with security implemented by ssh. https://github.com/apenwarr/sshuttle
  • "CompressionLevel" is ignored in SSH v2 and higher. Supposedly the default is ideal.
  • "Cipher" is ignored in SSH v2 and higher. Use "Ciphers" and put your favorite on the front of the list. Type man ssh to see what ciphers are on your system.
  • Use arcfour (rc4) encryption for higher performance and very low load but be sure to enable re-keying by hour or by data volume. Rebuild OpenSSL and OpenSSH to include it.
  • Type
    ssh -vvv user@example.com
    for really detailed debugging information. More "v" means more verbose.
  • Try using "keychain" to discover, reap, and re-use those ssh-agents littering your system.
  • For seamless but secure remote execution: generate a new ssh key (ssh-keygen) without a pass-phrase; put the id and id.pub files on each "client" machine; add the id.pub to the authorized_keys file under the username used for the "server" end. Here's the trick: Insert restrictions before the public key, but all on the one long line. So instead of "ssh-dss AAAAB3blahblahblah..." in the authorized_keys, use "no-port-forwarding,no-X11-forwarding,command="/the/specific/command",from="client1.ip.addr,*.other.clients" ssh-dss AAAAB3blahblahblah..."



电影【窃听风云3】











Debian/Ubuntu Gnome: add folder to Places menu (Bookmarks in the left side bar)








There is Bookmarks menu in the file explore. To add a bookmark folder, select the folder then select Bookmarks menu and click Add.


电影【明日边缘】











serif 和 sans serif 字体的区别
















原文链接: http://hi.baidu.com/lofe99/item/36872815d80938088fbde461









MS Office in WINE: how to print to PDF








  • install cups-pdf:
    sudo apt-get install cups-pdf; mkdir ~/PDF
  • if the above does not work, try install the office extension
    WINEPREFIX="$HOME/.wine" wine SaveAsPDFandXPS.exe

See also




Install Monaco font on Linux








sudo mkdir -p /usr/share/fonts/mac
sudo wget -O /usr/share/fonts/mac/Monaco.ttf http://www.gringod.com/wp-upload/software/Fonts/Monaco_Linux.ttf
cd /usr/share/fonts/mac
sudo mkfontdir
sudo mkfontscale
fc-cache -vf



Debian 7 Wheezy: install Chinese fonts








  1. Install Chinese fonts:
    sudo apt-get install fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp
    sudo apt-get install fonts-droid ttf-droid 
    sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei xfonts-wqy
    sudo apt-get install fonts-arphic-ukai ttf-arphic-ukai fonts-arphic-uming ttf-arphic-uming
    
  2. Font config:
    vi ~/.fonts.conf
    <?xmlversion='1.0'encoding='utf-8'?>
    <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
    <fontconfig>
    <!-- prefered fonts -->
    <alias>
        <family>serif</family>
        <prefer>
            <family>DejaVu Serif</family>
            <family>Bitstream Vera Serif</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </prefer>
    </alias>
    <alias>
        <family>sans-serif</family>
        <prefer>
            <family>DejaVu Sans</family>
            <family>Bitstream Vera Sans</family>
            <family>Evermore Song</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>WenQuanYi Zen Hei</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
        </prefer>
    </alias>
    <alias>
        <family>monospace</family>
        <prefer>
            <family>DejaVu Sans Mono</family>
            <family>Bitstream Vera Sans Mono</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Micro Hei Mono</family>
            <family>WenQuanYi Zen Hei Mono</family>
            <family>Droid Sans Fallback</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL UMing CN</family>
            <family>AR PL ShanHeiSun Uni</family>
        </prefer>
    </alias>
    <!-- Default Alias -->
    <alias>
        <family>DejaVu Sans</family>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <!-- Generic font families -->
    <match target="pattern">
        <test name="family" qual="any">
            <string>serif</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Serif</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>sans-serif</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Sans</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>monospace</string>
        </test>
        <edit binding="strong" mode="prepend" name="family">
            <string>DejaVu Sans Mono</string>
        </edit>
    </match>
    <!-- Anti-alias -->
    <match target="font">
        <edit name="embeddedbitmap">
            <bool>false</bool>
        </edit>
    </match>
    <!-- WenQuanYi Bitmap Song -->
    <selectfont>
        <acceptfont>
            <pattern>
                <patelt name="family">
                    <string>WenQuanYi Bitmap Song</string>
                </patelt>
            </pattern>
        </acceptfont>
    </selectfont>
    <match target="pattern">
        <test name="family" qual="any">
        <string>WenQuanYi Bitmap Song</string>
        </test>
        <test compare="less" name="pixelsize" qual="any">
            <double>12</double>
        </test>
        <edit mode="assign" name="family">
            <string>WenQuanYi Micro Hei</string>
        </edit>
    </match>
    <match target="pattern">
        <test name="family" qual="any">
            <string>WenQuanYi Bitmap Song</string>
        </test>
        <test compare="more" name="pixelsize" qual="any">
            <double>16</double>
        </test>
        <edit mode="assign" name="family">
            <string>AR PL ShanHeiSun</string>
        </edit>
    </match>
    <!-- Alias -->
    <alias>
        <family>SimSun</family>
        <family>宋体</family>
        <accept>
            <family>LiHei Pro</family>
            <family>Evermore Song</family>
            <family>WenQuanYi Bitmap Song</family>
            <family>AR PL ShanHeiSun Uni</family>
        </accept>
        <default>
            <family>serif</family>
        </default>
    </alias>
    <alias>
        <family>SimHei</family>
        <family>黑体</family>
        <accept>
            <family>LiHei Pro</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </accept>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <alias>
        <family>微软雅黑</family>
        <family>Microsoft YaHei</family>
        <accept>
            <family>LiHei Pro</family>
            <family>WenQuanYi Micro Hei</family>
            <family>WenQuanYi Zen Hei</family>
        </accept>
        <default>
            <family>sans-serif</family>
        </default>
    </alias>
    <!-- -->
    <match target="font">
        <edit mode="assign" name="rgba">
            <const>rgb</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hinting">
            <bool>true</bool>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="hintstyle">
            <const>hintfull</const>
        </edit>
    </match>
    <match target="font">
        <edit mode="assign" name="antialias">
            <bool>true</bool>
        </edit>
    </match>
    </fontconfig>






If you just need basic chinese fonts. Just install the following:
sudo apt-get install fonts-arphic-bkai00mp fonts-arphic-bsmi00lp fonts-arphic-gbsn00lp ttf-arphic-bkai00mp ttf-arphic-bsmi00lp ttf-arphic-gbsn00lp



apt-get install flashplugin-installer and ttf-mscorefonts-installer via proxy








My desktop has not direct internet access but goes through a proxy. It fails to install the packages like flashplugin-installer or ttf-mscorefonts-installer. There are 2 solutions:
  • edit /etc/wgetrc
    sudo vi /etc/wgetrc
    http_proxy = http://your-proxy.your.org:3128
    substitude the proxy address and the port 3128 with your proxy address and port number. Save the file then run
    sudo apt-get install flashplugin-installer ttf-mscorefonts-installer
  • or for one-off installation:
    sudo http_proxy=http://your-proxy.your.org:3128 apt-get install flashplugin-installer ttf-mscorefonts-installer



Debian Wheezy: Install Microsoft Office 2007 (via WINE)








  1. Install wine and winetricks:
    sudo apt-get install wine winetricks
  2. Download msxml3.msi from cnet.com.
  3. Move msxml3.msi to ~/.cache/winetricks/msxml3:
    mkdir -p ~/.cache/winetricks/msxml3; mv ~/Downloads/msxml3.msi ~/.cache/winetricks/msxml3/
  4. Install msxml3.msi:
    winetricks msxml3
  5. Locate the setup.exe file from the Microsoft Office 2007 installation media/directory and run it with wine:
    wine /path/to/MSOffice2007/setup.exe



Gnome 3 classic: How to remove a icon(launcher) from the panel














Solution:
Hold Alt key while mouse right-clicking on the icon, it should pop up menu with options to let your Move or Remove from the panel








add-apt-repository works through a http proxy














Solution:
export http_proxy=http://<proxy>:<port>
export https_proxy=http://<proxy>:<port>
sudo -E apt-add-repository <repository>








Ubuntu 13.10: No dropbox tray icon








Solution:
sudo apt-get install libappindicator1



中文智能手机相关资讯站点











Android Phone: temporarily avoiding poor connections and DHCP issues








Got a Huawei G526, it sometimes fails to connect to my wireless router(DynaLink RTA 1046VW) and displaying Temporarily avoiding poor connections and the WIFI signal strength is Excellent. I found:
  • Restart the wireless router can fix the issus most of the time.


However, it is very unconvenient that you have to restart the router every time when the problem occurs. And I do not think it is the problem of the wireless router because other devices connect to the router without problem. (Also I found the Android phone works without this problem on other wireless routers/networks. So it must be a compatibility issue between the andoird phone and my wireless router.)
Then I found how to disable Avoid poor connection:
  • Go to Settings
  • Turn on WIFI and get into WIFI
  • Touch Menu key then select Advanced
  • Uncheck Avoid poor connections

Now reconnect the WIFI, I got the WIFI status connected. However, I found I cannot actually connect to the internet because there is no IP address assigned. To check if the IP is assigned:
  • Go to Settings
  • Get into WIFI
  • Touch Menu key then select Advanced
  • See IP address

Why other devices can get DHCP working without problem but not this Android phone? I found it is an caching issue of the DHCP client on the Android phone. You can clear the DHCP cache and restart your WIFI to fix the issus if you have adb or root access.

However, not everyone can root the device or know to how to use adb. And every time the problem happens, you have to clear the cache. My solution is now using static IP instead of DHCP:
  • Go to Settings
  • Select the network and hover for the pop up menu
  • Select Modify network
  • Scroll down and check Show advanced options
  • Change IP settings from DHCP to Static
  • Set IP address to 192.168.1.10, change it according to your wireless router.
  • Set Gateway to 192.168.1.1, change it according to your wireless router.
  • Network prefix length: 24
  • DNS 1: 192.168.1.1, change it accoring to your wireless router.
  • Click Save button.