Tuesday, July 28, 2015

Bootstrap

== Summary of today's review of Bootstrap ==

Bootstrap is the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first web sites. Bootstrap is completely free to download and use!
  • Download from: http://getbootstrap.com
  • Documentation on using JavaScript, CSS and Components are also on the above site.
  • Folder demo/ contains some nice examples of website templates. Good for quick start.
    • demo/assets/js/docs.min.js creates placeholder image. See examples/theme/ for examples.
    • In demo/examples/, for difference of static top and fixed top, you need to view in mobile phone mode.
    • Good ones for mobile: Carousel, cover, Dashboard, Grid, jumbotron-narrow, jumbotron, navbar-fixed-top, navbar-static-top, navbar, signin, sticky-footer-navbar, sticky-footer, theme.
  • Folder tests/ contains some tests of bootstrap.
  • Folder backup/ contains the downloaded boostrap zip distribution package.
  • Folder download/ contains the downloaded entire website of getbootstrap.com.
References:
  1. http://getbootstrap.com
  2. http://www.w3schools.com/bootstrap/

Monday, July 27, 2015

Upload timeout issue

This is a repeated scenario.

Now I'm trying to be as thorough as possible in fixing this.

In PHP, this can be related to the following parameters in php.ini (often /etc/php.ini):

max_execution_time = 60  ; seconds
max_input_time = 60         ; seconds
memory_limit = 512M        ; 0.5 GB
post_max_size = 1000M    ; 1 GB
upload_max_filesize = 1000M   ; 1 GB


If the upload is done through a SOAP client [1], then this parameter in php.ini also should be updated:

default_socket_timeout = 60 ; seconds

After this, apache web server needs restart. (e.g., on redhat, sudo /sbin/service httpd restart)


On windows, ASP.NET application, these parameters in web.config needs update [2]:

In system.web (maxRequestLength is in KB):
<httpRuntime maxRequestLength="1048576" executionTimeout="3600" />

And in system.webServer (maxAllowedContentLength is in bytes) (this is needed in IIS7 and later): 
<system.webServer>
  
<security>
     
<requestFiltering>
        
<requestLimits maxAllowedContentLength="1073741824" />
     
</requestFiltering>
  
</security>
</system.webServer>


References:
[1] http://stackoverflow.com/questions/9403486/error-fetching-http-headers-in-soapclient
[2] http://stackoverflow.com/questions/3853767/maximum-request-length-exceeded



Windows Domain Controller

On domain controller, show users from console:

dsquery user | sort

Show computers:

dsquery computer

Show help by typing "dsquery":

Description: This tool's commands suite allow you to query the directory
according to specified criteria. Each of the following dsquery commands finds
objects of a specific object type, with the exception of dsquery *, which can
query for any type of object:

dsquery computer - finds computers in the directory.
dsquery contact - finds contacts in the directory.
dsquery subnet - finds subnets in the directory.
dsquery group - finds groups in the directory.
dsquery ou - finds organizational units in the directory.
dsquery site - finds sites in the directory.
dsquery server - finds AD DCs/LDS instances in the directory.
dsquery user - finds users in the directory.
dsquery quota - finds quota specifications in the directory.
dsquery partition - finds partitions in the directory.
dsquery * - finds any object in the directory by using a generic LDAP query.

For help on a specific command, type "dsquery <ObjectType> /?" where
<ObjectType> is one of the supported object types shown above.
For example, dsquery ou /?.

Remarks:
The dsquery commands help you find objects in the directory that match
a specified search criterion: the input to dsquery is a search criterion
and the output is a list of objects matching the search. To get the
properties of a specific object, use the dsget commands (dsget /?).

The results from a dsquery command can be piped as input to one of the other
directory service command-line tools, such as dsmod, dsget, dsrm or dsmove.

Commas that are not used as separators in distinguished names must be
escaped with the backslash ("\") character
(for example, "CN=Company\, Inc.,CN=Users,DC=microsoft,DC=com").

Backslashes used in distinguished names must be escaped with a backslash
(for example,
"CN=Sales\\ Latin America,OU=Distribution Lists,DC=microsoft,DC=com").


Examples:
To find all computers that have been inactive for the last four weeks and
remove them from the directory:

        dsquery computer -inactive 4 | dsrm

To find all users in the organizational unit
"ou=Marketing,dc=microsoft,dc=com" and add them to the Marketing Staff group:

        dsquery user ou=Marketing,dc=microsoft,dc=com | dsmod group
        "cn=Marketing Staff,ou=Marketing,dc=microsoft,dc=com" -addmbr

To find all users with names starting with "John" and display his office
number:

        dsquery user -name John* | dsget user -office

To display an arbitrary set of attributes of any given object in the
directory use the dsquery * command. For example, to display the
sAMAccountName, userPrincipalName and department attributes of the object
whose DN is ou=Test,dc=microsoft,dc=com:

        dsquery * ou=Test,dc=microsoft,dc=com -scope base
        -attr sAMAccountName userPrincipalName department

To read all attributes of the object whose DN is ou=Test,dc=microsoft,dc=com:

        dsquery * ou=Test,dc=microsoft,dc=com -scope base -attr *

Directory Service command-line tools help:
dsadd /? - help for adding objects.
dsget /? - help for displaying objects.
dsmod /? - help for modifying objects.
dsmove /? - help for moving objects.
dsquery /? - help for finding objects matching search criteria.
dsrm /? - help for deleting objects.


Webcam setup is easy

It seems setting up a real time online webcam is easy.

An example: http://foscam.us/

The webcam will be IP based, so user can log in and watch anytime online. There is IR mode (Infrared), so you can watch during night. You can control orientation and angle of the camera.

Other choices are like BlueIris and Webcam Surveyor.




Friday, July 24, 2015

Free Git repository

Assembla no longer has free repository. Bitbucket.org allows free repository of team up to 5 members.

Note:
- Git ignore file list: http://git-scm.com/docs/gitignore

Monday, July 6, 2015

Batch script to copy files

The batch script below can be used to automate file copy. You need to modify it to adapt to your needs.

echo off
echo Copy script


REM Source machines.
set SERVERS[0]=machine1
set SERVERS[1]=machine2
set SERVERS[2]=machine3


REM Source folder pattern.

set PATTERN=Folder_Pattern
 

REM Target location root.
set ROOT=machine_target_root
set VERBOSE=1

set "x=0"

:SymLoop

if defined SERVERS[%x%] (
  REM call echo %%SERVERS[%x%]%%
  call set SERVER=%%SERVERS[%x%]%%
  echo %SERVER%


  REM Create target folder.

  mkdir %ROOT%\%SERVER%

  FOR /f "tokens=*" %%i in ('DIR /a:d /b \\%SERVER%\%PATTERN%') DO (
      if VERBOSE=1 (
          ECHO Copy from \\%SERVER%\%%i\* to %ROOT%\%SERVER%\%%i\
      )
      xcopy \\%SERVER%\%%i\* %ROOT%\%SERVER%\%%i\
  )

  set /a "x+=1"
  GOTO :SymLoop
)

:END

Blog Archive

Followers