Showing posts with label Win7. Show all posts
Showing posts with label Win7. Show all posts

Install Jobskee 1.1.3 on win7 localhost XAMPP 5.6.31 - opensource PHP job board

Trabla: Install Jobskee 1.1.3 on win7 localhost XAMPP 5.6.31 - opensource PHP job board

Install Jobskee 1.1.3 on win7 localhost XAMPP 5.6.31 - opensource PHP job board


Jobskee is an easy-to-install open source job board inspired by some of the best job boards online.

Jobskee PHP Job Board Official Site - http://jobskee.com

Solving:


Watch on YouTube


SQL script used in tutorial - to create Jobskee database and user:

CREATE DATABASE `jobskee` 
DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

CREATE USER 'jobskee-owner'@'localhost'; 
CREATE USER 'jobskee-owner'@'127.0.0.1';
CREATE USER 'jobskee-owner'@'::1';

SET PASSWORD FOR 'jobskee-owner'@'localhost' = PASSWORD('jobskee123$%');
SET PASSWORD FOR 'jobskee-owner'@'127.0.0.1' = PASSWORD('jobskee123$%');
SET PASSWORD FOR 'jobskee-owner'@'::1' = PASSWORD('jobskee123$%');


GRANT ALL PRIVILEGES ON `jobskee`.* TO 'jobskee-owner'@'localhost' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `jobskee`.* TO 'jobskee-owner'@'127.0.0.1' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `jobskee`.* TO 'jobskee-owner'@'::1' WITH GRANT OPTION;



Windows 7: create new folder HOTKEY

TrablaWindows 7: create new folder HOTKEY



Windows 7 create new folder HOTKEY



Solving:

To create new folder with hotkey
simply select windows and press

CTRL + SHIFT + N


Windows 7 create new folder HOTKEY example

Windows & IIS: stop IIS web server (IIS7)

Trabla: Windows & IIS: stop IIS web server (IIS7)  - it blocks 80 port, so xampp can't start


Windows & IIS: stop IIS web server (IIS7)


Solving:


Watch on YouTube


1. Open CMD as Administrator (Run As Administrator):

2. Type command + press "enter" :

net stop WAS


Official Docs: http://technet.microsoft.com/en-us/library/cc732317%28v=ws.10%29.aspx

Motivation Quotes Gadget for Win7

Tutorial: Motivation Quotes Gadget for Win7


Howto make Motivation Quotes Gadget for Windows 7 - codingtrabla tutorial 1


















Spec: simple gadget with motivation quotes.
Also displays author and author image.
Quotes changes every 10 seconds.

Steps Overview:
1. Create Gadget Folder Structure
2. Create gadget.xml - mandatory descriptor file
3. Create index.html - view of gadget
4. Create app.css
5. Create app.js - quote update logic
6. Create quotes.js - storage of quotes/author/image name
7. Add some images
8. How to install and run gadget

Steps Details:

1. Create Gadget Folder Structure:
 - Create folder "Motivation.Gadget" on desktop
 - Create subfolder "images" in "Motivation.Gadget"
 - Create subfolder "js" in "Motivation.Gadget"
 - Create subfolder "css" in "Motivation.Gadget"

Result:
Howto make Motivation Quotes Gadget for Windows 7 - codingtrabla tutorial 2










2. Create gadget.xml - mandatory descriptor file in folder "Motivation.Gadget"

<?xml version="1.0" encoding="utf-8" ?>
<gadget>
  <name>Motivation</name>
  <version>1.0.0.1</version>
  <author name="Samurai Kit">
    <info url="codingtrabla.blogspot.com" />
  </author>
  <description>Go! Go! Go!</description>
  <hosts>
    <host name="sidebar">
      <base type="HTML" apiVersion="1.0.0" src="index.html" />
      <permissions>Full</permissions>
      <platform minPlatformVersion="1.0" />
    </host>
  </hosts>
</gadget>

3. Create index.html in folder "Motivation.Gadget" - view of gadget

<html>
<head>
<meta http-equiv="MSThemeCompatible" CONTENT="yes" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Never Give Up!!!</title>
    <link href="css/app.css" rel="stylesheet" type="text/css" />
    <script src="js/quotes.js" language="javascript" type="text/javascript"></script>
    <script src="js/app.js" language="javascript" type="text/javascript"></script>
</head>
<body onload="initUI()">
    
<table style="width:100%" >
<tr>
<td width="75%" align="center" >

<span id id="quote">&nbsp;</span>
<span id="author">&nbsp;</span>

</td>
<td width="25%" align="right">


<div id="image">&nbsp;</div>

</td>
</tr>

</table> 
    
</body>
</html>

4. Create app.css in folder "Motivation.Gadget/css"

body
{
    background-color: white;
    background-image:url(../images/background.png);
    width: 550px;
    height: 160px;
}

#author{
width:100%;
font-size: medium;
text-align: right;
    color:white;
    font-family:Courier New;
}

#quote{
color:white;
    font-style: italic;
    font-size: large;
}

5. Create app.js - quote update logic in folder "Motivation.Gadget/js"


var REFRESH_INTERVAL = 10000;

var updateInterval;
var quote;
var author;
var image;

var currentQuote = 0;
var quotesQty = 0;

var space = '&nbsp;';
var lquote = '&ldquo;';
var rquote = '&rdquo;';
var mdash = '&mdash;';

function initUI(){
    
    quote = document.getElementById("quote");
    author = document.getElementById("author");
    image = document.getElementById("image");

    quotesQty = window.quotes.length; 

    updateQuote();
    updateInterval = setInterval(updateQuote, REFRESH_INTERVAL);
    
}


function updateQuote(){
   
    quote.innerHTML = lquote + space + window.quotes[currentQuote].quote + space + rquote;
    author.innerHTML = mdash + space + window.quotes[currentQuote].author + space ;
    image.innerHTML = '<img width="120" height="120" src="/images/'+window.quotes[currentQuote].image+'">';

    if( currentQuote == quotesQty - 1 ){
    currentQuote = 0;
    }else{
    currentQuote = currentQuote + 1;
    }
}


6. Create quotes.js in folder "Motivation.Gadget/js"  - storage of quotes/author/image name

window.quotes = [
    {
        "quote":"Never, never, never give up.",
        "author":"Winston Churchill",
        "image":"churchill1.png"
    },

    {
        "quote":"Just Do It!",
        "author":"Nike",
        "image":"nike.png"
    },

    {
        "quote":"Go! Go! Go!",
        "author":"Counter Strike",
        "image":"cs.png"
    },

    {
        "quote":"Uuuuuuuuur Ahhhhrrrrrr Uhrrrr Ahhhhrrrrrr Aaaarhg...",
        "author":"Chewbacca",
        "image":"chewbacca.png"
    },

    
    {
        "quote":"Why don't you try again? A little harder",
        "author":"Shifu",
        "image":"shifu.png"
    },

    {
        "quote":"Success consists of going from failure to failure without loss of enthusiasm.",
        "author":"Winston Churchill",
        "image":"churchill2.png"
    },
    
    {
        "quote":"To make something special, you just have to believe it's special.",
        "author":"Mr. Ping",
        "image":"mrping.png"
    },
    
    {
        "quote":"Your mind is like this water my friend, when it is agitated it becomes difficult to see. But if you allow it to settle, the answer becomes clear.",
        "author":"Oogway",
        "image":"oogway.png"
    }
   
];


7. Add some images (use correct names ) into "Motivation.Gadget/images" folder

background.png

 chewbacca.png
 churchill.png
 churchill2.png
 cs.png
 mrping.png
nike.png
 oogway.png
shifu.png










8. How to install and run gadget
- Copy folder "Motivation.Gadget"
to C:\Users\<YOUR_USER_FOLDER>\AppData\Local\Microsoft\Windows Sidebar
e.g. C:\Users\samuraikit\AppData\Local\Microsoft\Windows Sidebar

- Right mouse click on desktop - > Gadgets - "Motivation"

Howto make Motivation Quotes Gadget for Windows 7 - codingtrabla tutorial 3












Have a fun :)


Howto make Motivation Quotes Gadget for Windows 7 - codingtrabla tutorial 4










Sources on GitHub:
https://github.com/samuraikit/win-7-motivation-gadget

Windows: 0xc0000005 error after update

Trabla: Windows: 0xc0000005 error after update
- error caused by different updates which change core files.

Solving:

1. Run command line
2. Execute

wusa.exe /uninstall /kb:2859537
wusa.exe /uninstall /kb:2872339
wusa.exe /uninstall /kb:2882822

kb:2882822 - was my system problem

Redmine & Windows & PostgreSQL : installation tutorial

Trabla: Redmine & Windows & PostgreSQL : installation tutorial


Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 1




Solving:




1.  Download and install PostgreSQL database, remember to set up password

http://www.enterprisedb.com/products-services-training/pgdownload#windows
(I used Postgres 9.3)

2.  Download and install RailsInstaller - tool to install ruby + rails

http://railsinstaller.org/en
( I used railsinstaller-2.2.4.exe )

Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 2
























Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 3



















Installation creates C:\Sites   folder where ruby projects shoud be placed.


3.   Download Redmine sources

http://www.redmine.org/projects/redmine/wiki/Download
( I used redmine-2.5.2.zip )

Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 4

























4. Create folder  C:\Sites\redmine and copy all sources from redmine sources .zip


Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 5


























5.  Create empty  database and name it "redmine" in PostgreSQL using pgAdmin III


Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 6

Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 7

Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 8

 Result:
Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 9

6. Setup database connection configuration  in folder C:\Sites\redmine\config
- copy file database.yml.example, and rename copy to database.yml


Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 10


















7. Open database.yml     and comment (put # symbol at begining of line ) all configuration,
uncomment postgresql production configuration - fill with database connection data + SAVE

my example, file  C:\Sites\redmine\config\database.yml 

# Default setup is given for MySQL with ruby1.9. If you're running Redmine
# with MySQL and ruby1.8, replace the adapter name with `mysql`.
# Examples for PostgreSQL, SQLite3 and SQL Server can be found at the end.
# Line indentation must be 2 spaces (no tabs).

#production:
#  adapter: mysql2
#  database: redmine
#  host: localhost
#  username: root
#  password: ""
#  encoding: utf8

#development:
#  adapter: mysql2
#  database: redmine_development
#  host: localhost
#  username: root
#  password: ""
#  encoding: utf8

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
#test:
#  adapter: mysql2
#  database: redmine_test
#  host: localhost
#  username: root
#  password: ""
#  encoding: utf8

# PostgreSQL configuration example
production:
  adapter: postgresql
  database: redmine
  host: localhost
  username: postgres
  password: "pg123"  #Put your password here

# SQLite3 configuration example
#production:
#  adapter: sqlite3
#  database: db/redmine.sqlite3

# SQL Server configuration example
#production:
#  adapter: sqlserver
#  database: redmine
#  host: localhost
#  username: jenkins

#  password: jenkins

8.  Change file C:\Sites\redmine\Gemfile
change lines

gem "rmagick", ">= 2.0.0"    to  # gem "rmagick", ">= 2.0.0" 

gem "rake", "~> 10.1.1"  to  gem "rake", "~> 10.3.2"


+ Save file
  
9. Start command line with ruby
Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 11



















10. Execute command in cmd

C:\Sites>cd C:\Sites\redmine
C:\Sites\redmine>bundle install
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
.......
Your bundle is complete!

C:\Sites\redmine>set RAILS_ENV=production
C:\Sites\redmine>set REDMINE_LANG=en
C:\Sites\redmine>rake db:migrate
.......
==  ChangeChangesetsCommentsLimit: migrated (0.0000s) =========================

C:\Sites\redmine>rake redmine:load_default_data
Default configuration data loaded.

C:\Sites\redmine>rake generate_secret_token

C:\Sites\redmine>ruby script/rails server webrick -e production
=> Booting WEBrick
=> Rails 3.2.19 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2014-10-12 19:37:52] INFO  WEBrick 1.3.1
[2014-10-12 19:37:52] INFO  ruby 1.9.3 (2014-02-24) [i386-mingw32]

[2014-10-12 19:37:52] INFO  WEBrick::HTTPServer#start: pid=3320 port=3000
Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 12




11. Open browser and goto http://localhost:3000      
sign in as admin  using login/password    admin/admin

Howto install Redmine with PostgreSQL database on Windows 7 - codingtrabla tutorial 13

Windows & CMD: fc command - text diff (compare) files

Trabla: Windows & CMD: fc command - text diff (compare) files

Solving:

1. File 1 - test1.php
<?php

echo 'test1';
echo 'bla';
echo 'zzz';
echo 'return1';
echo 'lalala';

?>


2. File 2 - test2.php

<?php

echo 'test2';
echo 'bla';
echo 'zzz';
echo 'return2';

?>


3. Use fc command
fc /N /A test1.php test2.php



Comparing files test1.php and TEST2.PHP
***** test1.php
    2:
    3:  echo 'test1';
    4:  echo 'bla';
***** TEST2.PHP
    2:
    3:  echo 'test2';
    4:  echo 'bla';
*****

***** test1.php
    5:  echo 'zzz';
...
    8:
***** TEST2.PHP
    5:  echo 'zzz';
    6:  echo 'return2';
    7:
*****


4. fc command command help
fc /?
Compares two files or sets of files and displays the differences between
them

FC [/A] [/C] [/L] [/LBn] [/N] [/OFF[LINE]] [/T] [/U] [/W] [/nnnn]
   [drive1:][path1]filename1 [drive2:][path2]filename2
FC /B [drive1:][path1]filename1 [drive2:][path2]filename2

  /A         Displays only first and last lines for each set of differences.
  /B         Performs a binary comparison.
  /C         Disregards the case of letters.
  /L         Compares files as ASCII text.
  /LBn       Sets the maximum consecutive mismatches to the specified
             number of lines.
  /N         Displays the line numbers on an ASCII comparison.
  /OFF[LINE] Do not skip files with offline attribute set.
  /T         Does not expand tabs to spaces.
  /U         Compare files as UNICODE text files.
  /W         Compresses white space (tabs and spaces) for comparison.
  /nnnn      Specifies the number of consecutive lines that must match
             after a mismatch.
  [drive1:][path1]filename1
             Specifies the first file or set of files to compare.
  [drive2:][path2]filename2
             Specifies the second file or set of files to compare.


Win7 & node.js : Hello World app

Trabla:  node.js "Hello World" app on Win 7

Solving:
1. Goto http://nodejs.org/download/
2. Download and install Windows version
3. Create folder structure on disk C
C:\nodejs_projects\helloworld
4. Create file helloworld.js in folder C:\nodejs_projects\helloworld
5. Put code into helloworld.js file and save

var http = require('http');

http.createServer(function(req, res){
res.writeHead(200, {'content-type':'text/plain'});
res.end('Hello World');
}).listen(9003);

console.log('Nodejs Server is running on port 9003!');

6. Run windows command line
7. Execute following commands in command line
cd  C:\nodejs_projects\helloworld
node helloworld.js

8. Open browser and goto url
http://localhost:9003/

Windows: cmd - turn system off

Trabla: turn system off via command line.

Solving:
Type command and pess enter:
shutdown  /s

Win7: Task Sheduler - clean Temp folder

Intro:  Windows 7 Temp folder is all apps "garbage collector". If don't clean it - it becomes bigger and bigger and your disk space melts away, e.g. my temp folder growth to 3Gb.


So we need scheduled task-cleaner.

Steps to solve problem:

1. Create .bat script that cleans TEMP folder

2. Create Windows 7 scheduled task - trigger .bat cleaner-scipt every day execution.

Stepts in details:

1. Create .bat script that cleans TEMP folder:

1.1 Create folder "scheduler tasks" in disk C:/ root

1.2 Create text file

1.3 Type .bat script   + save file

CD %TEMP%
DEL /S /Q -R *.*


Script explanation:

CD  %TEMP% - change directory to temp folder

DEL /S /Q -R *.* - delete files, where params

/S - delete from all Subfolders (DELTREE)

/Q - quiet mode, do not give a Yes/No Prompt before deleting.

-R -  NOT Read-only files

 *.* - file name pattern - any file names with any extensions, any folders

1.4 Rename file to "clean_temp_folder"

1.5 Change file extension to ".bat" - make sure showing extension is enabled in folder options (control panel).

Result should looks like pictures below:



Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 1
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 2


2. Create Windows 7 scheduled task - trigger .bat cleaner-scipt every day execution.

2.1  Goto Start->'Control Panel'

2.2  Double click on "Administrative Tools"
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 3

 2.3 Double click on "Task Scheduler"
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 4

2.4 Click "Create Task"

Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 5

2.5 Type "Task Name"

Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 6

2.6 Select tab "Triggers" - click button "New"

Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 7

2.7 In "New trigger" select radio button "daily" and click button "OK"
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 8

2.8 Goto tab "Action" + click button "New"
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 9

2.9 Setup action - "start program" and set our bat script
Windows 7 Task Sheduler - clean Temp folder - codingtrabla tutorial screenshot 10

2.10 Click "OK" in Task dialog to save task

That's all!!! Hooray!!!