We all know that Git is a very good VCS, with redmine, like Bugzilla, we have even better control and graphical view on our repository, and this is undoubtedly aid development. The following is how to make the whole VCS system happens.
What we need
1) Git (of course!)
2) Redmine
3) Apache Server
Run python setup.py build and your program will be built
Follow the file structure to build the deb
mpstoolbox is the app name, name your own one
DEBIAN/control, DEBIAN/postinst is files to configure the deb package
usr/bin/..., this is the installed path, you should make your own path, all the files installed will follow this path structure
Finally, cd back to the folder (your app name), use dpkg -b yourAppName
A deb package will be generated
Use dpkg -i to install
Here comes the MOST important part, my problem
It seems simple to follow the above to build the program, but indeed it doesn't, the guide does not teach you clearly on how to include the required modules to let you bring your program to other Linux machine to run, you need to follow the followings
binpathincludes parameter is important, please include all system library like /usr/lib, /usr/local/lib, or you may encounter this error libwx_gtk2u import error, ImportError: libwx_gtk2u_adv-2.8 etc. This is deal to the missing of wxPython library, you therefore need to include all required system library when building the app
One thing here to pay attention to, the "include_files" attribute should be a list of tuples instead of single name only!! Your external files and other required images should also put it here.
We often need to install multiple OS in one system, for example
Windows 8 & Ubuntu 12
Ubuntu 12 & Ubuntu 14
Windows 8 & Ubuntu 12 & Ubuntu 14...
We often follow the below instructions to achieve (assuming you have ONE Windows pre-installed and ONE Ubuntu pre-installed and you want to install the third OS, also Ubuntu)
Navigate to the BIOS, set the USB Ubuntu stick as the booting machine
Turn off the security boot to prevent the laptop not loading the USB (subjected to change on different BIOS)
Turn off the EUFI boot specifically for Windows 8 to avoid always booting to Windows instead of Ubuntu
Boot overriding the USB drive (subjected to change on different BIOS), if no boot overriding exists, just follow the old school boot priority function
Make a new partition for your Ubuntu, remember if you lack disk space, you will need to do partition resizing and be-careful not to override the Windows partition or you may not be able to boot into Windows again!! Before installing the new OS, make sure you which partition which OS refers to.
After adding/resizing the partition, format it with ext4
You will need to provide the mounting point (I usually pick "/") and create a very small bootloader partition called "Reserved BIOS Boot Area" for GRUB's code, this is VERY IMPORTANT, grub provides a boot menu for you to navigate to different OS, we need to provide it with some space (normally as small as 1MB), after creating both partitions, you are okay to proceed to the installation processes.
Follow the Ubuntu install guide to finish the installation.
In the final step, Ubuntu will ask you to restart the machine, just do so.
Luckily you will find a Linux boot menu listing all the partitions included (e.g. /dev/sda1,sda2.... etc.) but we will miss our newly installed OS partition, we need to update the grub file to reflect the changes (OS addition)
Boot into the pre-installed Ubuntu (the one before our third OS installation), navigate to /etc/default/grub and use text editior to edit it.
We only interest in GRUB_DEFAULT, this controls which OS the default OS should boot in, choose the one you want and save the setting
Remember after updating the file, you will need to UPDATE by sudo update-grub , if not the newly installed OS will not appear in the grub menu
Reboot the machine and you will see the newly installed OS appeared.
This is official explanation /** * The function that handles definitions of modules. Differs from * require() in that a string for the module should be the first argument, * and the function to execute after dependencies are loaded should * return a value to define the module corresponding to the first argument's * name. */
jquery, bootstrap etc. is the self-defined name of js scripts to load, they are loaded in order
We must load the controller module for the AngularJS controller to work properly
Inside require function we have a second require function,which is called sugar function, it only loads the required modules for use inside the function, if you don't need it, you are NOT required to include in function parameters.
angular.bootstrap is to manually trigger the start of angularJS, which is highly recommended to use when cooperate with requireJS
When this was set, NO exists in the html view or AngularJS will throw errors
Normally, we will ignore the first parameter of the define function and let requireJS to use the file name as the module name (recommended)
Second array parameter tells requireJS that insiderApp module requires angular, angular-route and angular-animate to be loaded before executing the insiderApp module
function parameter "angular" is returned by the angular function, this object is for the implementation of insiderApp
Return the insiderApp variable or not depends on whether or not other modules need insiderApp, normally you need to return it.
var insiderApp = angular.module("insiderApp",["ngRoute", "ngAnimate"]); Just like usual, start the angular module, we can do any configuration of the angular object in this file.
controller.js
Just like usual, controller of the Angular object
define(['insiderApp'],function(insiderApp)...
Controller rely on insiderApp for adding controller to the Angular module, so we need to put insiderApp to the array and use it inside the function
Sometimes you will need some http authentication for the uhttpd server, if it is so, we can follow the below steps to achieve.
Set up the uhttpd config file
config uhttpd 'main'
list listen_http '0.0.0.0:80'
list listen_http '[::]:80'
list listen_https '0.0.0.0:443'
list listen_https '[::]:443'
list interpreter '.php=/usr/bin/php-cgi'
/*Use php as interpreter, add it if you want to load php correctly*/
option home '/www'
/*Actual web file is placed in this folder*/
option rfc1918_filter '1'
option max_requests '3'
option max_connections '100'
option cert '/etc/uhttpd.crt'
option key '/etc/uhttpd.key'
option cgi_prefix '/cgi-bin'
option script_timeout '60'
option network_timeout '30'
option http_keepalive '20'
option tcp_keepalive '1'
option ubus_prefix '/ubus'
option listen_http '8080'
/*listen to http 8080, you can make your own listening port*/
option config '/etc/httpd.conf'
/*Specify the config for username and password for http auth*/
Make a file called "httpd.conf" under /etc directory
Modify the file with the following, basically, the first parameter is the directory you want to protect /:username:password
For the above, we specify the column 0 to be invisible, but when I refresh my page, I cannot see anything, we need to clear the cookies to achieve the changes, the only reason for this I guess would be the bState parameter which use the cookie to save the sorting history and other datatable profiles.
***And usually you may need to restart the chrome browser with the private mode to reflect the changes***
I will update this doc if any new hints of datatables found.
Sometimes, we may want to control the download behavior through http server, in this case, we often need to override the htaccess config file to achieve.
Scenario 1: No authentication is needed
1) Make .htacess file with the below content
Allow from all
Satisfy any
2) After that, put the file to the directory, the following is the result (hierarchy level)
downFolder yourFileName .htacess
So everytimethe user download the file, they will not be asked for password
Scenario 2: Authentication with Username and Password
1) Make .htacess file with the below content
AuthType Basic
AuthName "yourProtectedMsg"
AuthUserFile pathOfYourHtapasswdFile
Require user loginUsrName
Steam contains a very good feature called "Steam In-Home Streaming" which allow streaming of PC games in LAN or even through the Internet using VPN, with this feature one can use the strong desktop power to stream to other machines with different platform like MAC and Ubuntu, with the help of Steam software.
Environment
Windows 7 64 bit Ultimate Edition / MAC OS/ Ubuntu
A strong processing power PC (Steam suggest Intel Core i3 or above for the host computer for better performances)
OpenVPN (ASUS routers internally includes openVPN servers), do not use PPTP server inside the router as this will not work (reason: PPTP has no UDP port forwarding)
Set up VPN server (in my case, I use openVPN server provided by merlin build), turn on it.
Select advance settings, follow the below settings * Remember to select "TAP", for steam steaming to work, bridging is required. * Username auth and password should be enabled * Allow connections between clients
Make a new open vpn account in the top page (not in the advance set up page!)
Export the settings (.ovpn)
Import the ovpn file to the client openVPN located in C:\Program Files\OpenVPN\config and do the connection.
Back to application, both side should have Steam opened, and make sure they are at the same LAN, you should have an option to stream your game.
Sometimes, we open a new account for special purposes but do not want to the account to be shown at home screen, if it is so, please follow the below steps to achieve.
Environment:
Windows 7 (64 bit) Ultimate Edition
1) Go to start
2) Type Regedit
3) Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\WindowsNT\CurrentVersion\Winlogon
4) Right click "Winlogon" and make a new key (K)
5) Name "SpecialAccounts" and press enter
6) Right click the newly created SpecialAccounts, make a new key again named "UserList"
7) On the RHS of the panel, add a DWORD (32bit) value, name the value with the account name you want to hide.
8) The value of the DWORD is evaluated as follows 0: Hide 1: Show
9) You do not need to restart computer, this will be in effect instantly.
The following is the some notes of setting up remote login for machines behind routers (NAT)
Environment:
Windows 7 (64 bit) Ultimate Edition
Asus N66U router
Setup port forwarding (default 3389 port)
Under Windows "Firewall > Advanced setup, choose inbound connection, open tcp port 3389 to allow remote login services
Finally, go to Advanced system settings > remote > allow all remote connections from different versions of Windows (default is closed for security, need to open manually)