#define READ_VALUE(n, p, i) ((n) >> (p)) & ((1 <<(i)) - 1)
The above macro return the byes of specified position
#define READ_VALUE(n, p, i) ((n) >> (p)) & ((1 <<(i)) - 1)
The above macro return the byes of specified position
apache2postgresql-9.1.7
or latestphp5php5-cliphp5-pgsqlphp-pearphp5-curlphp5-ldapphp5-gdpostfixcvscurlpostfix// Edit Postgres
config
vim /etc/postgresql/9.1/main/pg_hba.conf
// Use trust
for both
# Database administrative login by UNIX sockets
local
all postgres trust
# "local" is for Unix domain socket
connections only
local all all trust
// Restart
Postgres
etc/init.d/postgresql restart// Create users
and DB
createuser -SRDU postgres matrix
createuser -SRDU
postgres matrix_secondary
createdb -U postgres -O matrix -E UTF8
squiz_matrix
createlang -U postgres plpgsql squiz_matrixInstall Matrixmkdir /home/websites
cd /home/websites
//
Checkout and install Matrix
curl -O
http://public-cvs.squiz.net/cgi-bin/viewvc.cgi/mysource_matrix/scripts/dev/checkout.sh?view=co
mv
checkout.sh\?view\=co checkout.sh
sh checkout.sh mysource_4-12-3Set Domain namevim /etc/hostsadd the line
Init Matrix// Init the main config
cd
/home/websites/squiz_matrix
php install/step_01.php
/home/websites/squiz_matrix
// Edit the main config file
vim
data/private/conf/main.inc
// The following configuration settings
need to be completed as a minimum
define('SQ_CONF_SYSTEM_ROOT_URLS',
'www.squizserver.com');
define('SQ_CONF_DEFAULT_EMAIL',
'sabeesh.cs@sterian.com');
define('SQ_CONF_TECH_EMAIL',
'sabeesh.cs@sterian.com');
// Edit Database file
vim
data/private/conf/db.inc
// Update the PHP array
$db_conf =
array (
'db' => array
(
'DSN'
=> 'pgsql:dbname=squiz_matrix',
'user'
=> 'matrix',
'password'
=> '',
'type'
=> 'pgsql',
),
'db2'
=> array (
'DSN'
=> 'pgsql:dbname=squiz_matrix',
'user'
=> 'matrix',
'password'
=> '',
'type'
=> 'pgsql',
),
'db3'
=> array (
'DSN'
=> 'pgsql:dbname=squiz_matrix',
'user'
=> 'matrix_secondary',
'password'
=> '',
'type'
=> 'pgsql',
),
'dbcache'
=> NULL,
'dbsearch'
=> NULL,
);
return
$db_conf;
// Init database schema
php install/step_02.php
/home/websites/squiz_matrix
// Install core asset types
php
install/compile_locale.php /home/websites/squiz_matrix
php
install/step_03.php /home/websites/squiz_matrix
php
install/compile_locale.php /home/websites/squiz_matrix
Fix PermissionsDo this process as root user / use sudo
before each commandchmod -R 755 /home/websites/squiz_matrix
cd
/home/websites/squiz_matrix
chown -R www-data:www-data data
cache
chmod -R g+w data cache
Apache// Edit apache
virtual hosts file
vim /etc/apache2/sites-enabled/000-default
//Remove existing, need to check this
ServerName server.example.com
DocumentRoot
/home/websites/squiz_matrix/core/web
Options -Indexes
FollowSymLinks
Order deny,allow
Deny from all
Order allow,deny
Allow from all
php_flag engine off
Order allow,deny
Deny from all
Order allow,deny
Deny from all
Alias /__fudge /home/websites/squiz_matrix/fudge
Alias
/__data /home/websites/squiz_matrix/data/public
Alias /__lib
/home/websites/squiz_matrix/core/lib
Alias /
/home/websites/squiz_matrix/core/web/index.php/
// Restart apache
/etc/init.d/apache2 restartCron Setup// Edit apache
user cron file
crontab -u www-data -e
( select option 4
for editer )
// Add cron
jobs
*/15 * * * * php
/home/websites/squiz_matrix/core/cron/run.php
0 0 * * *
/home/websites/squiz_matrix/scripts/session_cleanup.sh
/home/websites/squiz_matrix
*/15 * * * * php
/home/websites/squiz_matrix/packages/bulkmail/scripts/run.php
Install JRE sudo apt-get purge openjdk*After that, go and download Java JRE package from http://www.oracle.com/technetwork/java/javase/downloads/jre7-downloads-1880261.html .
When prompted, save the download. Please select the 32 or 64 bit.tar.gzversion file from the list.
After
saving the file, go back to your terminal and run the below commands
to extract the java packages you downloaded.tar -xvf ~/Downloads/jre-7u13-linux-i586.tar.gz
Next,
create your java 7 folder by running the commands below.sudo mkdir -p /usr/lib/jvm/jre1.7.0
Then
move all the extracted files and folders into the java 7 folder.sudo mv jre1.7.0_13/* /usr/lib/jvm/jre1.7.0/
Next,
run the commands below to install / update java 7sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0/bin/java 0
Next,
create a plugin folder in your home directory by running the commands
below.mkdir ~/.mozilla/plugins
Finally, link the java plugin to your profile.ln -s /usr/lib/jvm/jre1.7.0/lib/i386/libnpjp2.so ~/.mozilla/plugins/
Load Firefox,
Tools->Add-ons, select java, ( Quick java ) and install.Load the “
www.squizserver.com
“ and enjoy!| CultureInfo cultureInfo = new CultureInfo("en-US"); |
| DateTimeFormatInfo dateInfo = new DateTimeFormatInfo(); |
| dateInfo.ShortDatePattern = "MM/yyyy"; |
| cultureInfo.DateTimeFormat = dateInfo; |
| radDatePicker1.Culture = cultureInfo; |
//FirstWindow.h
#pragma once
using namespace System; using namespace System::Windows; using namespace System::Windows::Controls;
ref class Functor;
ref class FirstWindow : Window { Canvas^ maincanvas; Button^ addbutton1; Button^ addbutton2; Functor^ pFunctor; public: FirstWindow(void); void InitControls(void); void MyFunction( int x, int y );
};
//FirstWindow.cpp #include "FirstWindow.h" #include "Functor.h"
FirstWindow::FirstWindow(void) { Title = "First Avalon App"; Width = 400; Height = 400; ResizeMode = System::Windows::ResizeMode::NoResize;
InitControls();
}
void FirstWindow::InitControls(void) { addbutton1 = gcnew Button(); addbutton1->Width = 80; addbutton1->Height = 25; addbutton1->Content = "Add"; pFunctor = gcnew Functor(this, 10, 20); addbutton1->Click += gcnew RoutedEventHandler( pFunctor, &Functor::Handler);
Canvas::SetTop(addbutton1, 45);
Canvas::SetLeft(addbutton1, 200);
pFunctor = gcnew Functor(this, 100, 200);
addbutton2 = gcnew Button();
addbutton2->Width = 80;
addbutton2->Height = 25;
addbutton2->Content = "Add";
addbutton2->Click += gcnew RoutedEventHandler(pFunctor, &Functor::Handler);
Canvas::SetTop(addbutton2, 85);
Canvas::SetLeft(addbutton2, 200);
maincanvas = gcnew Canvas();
maincanvas->Children->Add(addbutton1);
maincanvas->Children->Add(addbutton2);
Content = maincanvas;
}
void FirstWindow::MyFunction( int x, int y ) { MessageBox::Show("This function is call by Button Click with values " + x.ToString() + " , " + y.ToString() ); }
//Functor.h #pragma once
using namespace System; using namespace System::Windows; using namespace System::Windows::Controls;
ref class FirstWindow;
private ref class Functor { public: Functor(FirstWindow^ pFirstWindow, int pFirstArg, int pSecArg);
// This is what we will use as the handler method
void Handler(Object ^ sender, RoutedEventArgs ^ e);
private: int m_pFirstArg; int m_pSecArg; FirstWindow^ m_pFirstWindow; };
//Functor.cpp
#include "Functor.h" #include "FirstWindow.h"
Functor::Functor(FirstWindow^ pFirstWindow, int pFirstArg, int pSecArg) : m_pFirstWindow( pFirstWindow ), m_pFirstArg(pFirstArg), m_pSecArg( pSecArg ) {
}
void Functor::Handler(Object ^ sender, RoutedEventArgs ^ e) { if ( m_pFirstWindow ) m_pFirstWindow->MyFunction(m_pFirstArg, m_pSecArg );
}
Now when we click on button one, then the application call the function "MyFunction" with value 10,20 and when we click on button 2 then the same function "MyFunction" with value 100,200.
How can I start a computer over the network?
There are two different procedures, depending on whether the target computer is in standby/sleep/suspend mode or whether it is actually powered down in hibernate mode or entirely off.
Note that you cannot wake a computer that is powered down over a WLAN connection. Only cable connections will do.
Now your computer should wake up from standby whenever the network card is accessed by any other computer. If it doesn't, check any relevant BIOS settings, but usually there aren't any.
A frequent problem is that the computer is woken up by all and sundry network traffic, hence it may be better to send the computer to hibernate mode or shut it down and off altogether and use the following method.
One way to do this is the following.
If you need the opposite function as well, to shut down a computer remotely, have a look at:
http://www.microsoft.com/technet/sysinternals/utilities/PsShutdown.mspx
This program, PsShutdown, is a member of Sysinternals' PsTools group of freeware utilities.
To shut down and power down a remote computer named "computername", enter the command:
psshutdown -k -f -t 00 \\computername
-k indicates shutdown and powerdown, -f means force all running programs to close without asking, and -t 00 means don't wait (wait zero seconds) until shutting down the computer named computername. (Don't miss the required space between -t and 00.) This utility can do several other things as well, like sending the target computer into hibernate mode or rebooting it.
One example of how to wake up a home or office computer across the Internet is the following.
Assume a home network with a WAN router, in this case a DrayTek Vigor 2500We with firmware version 2.54. The main problem is that you cannot use any of the usual methods to address the target computer. Since it is off, it has no IP address. False advice is widespread, because people keep forgetting this simple fact.
The router has to send a special broadcast packet into the Local Area Network, using the MAC (Media Access Control) address, rather than the IP address. With some routers you may be able to achieve this by sending a Wake-On-LAN packet to the router and forward the port to an internal broadcast address, for example: 192.168.0.255
With most routers, however, this still does not work. You have to rely on the router to have the special ability to forward or send a Wake-On-LAN broadcast packet. In the case of the DrayTek router this can only be achieved through the telnet interface, but unfortunately not yet through the Web interface. An example for the telnet command for this DrayTek router is:
wol up 00E01890A545
Of course you have to replace the hex number with the MAC address of your target computer, and for this particular router you cannot intersperse hyphens as usual. The router needs the address in the direct short hexadecimal format. Check your router's manual or help system for its specifics.
Wake on Lan Command Line
http://www.depicus.com/wake-on-lan/wake-on-lan-cmd.aspx
The command line tool wolcmd is run from a dos prompt. The syntax is as follows:
wolcmd [mac address] [ip address] [subnet mask] [port number]
you can also do a local broadcast if you are running on an internal network thus
wolcmd [macaddress] 255.255.255.255 255.255.255.255
where mac address is the unique address of the network card. To find the mac address of a card you can either open the computer and read the address on the sticker on the card or much easier is, if you are using TCP/IP, ping the machine from a dos prompt (ping [machine name or ip number] i.e. ping delphi or ping 10.43.43.43) then issue an arp command (arp -a) which will list the ip number and physical address of the card.
If the port number is not specified it will default to port 7
Running from a batch file
Simply add multiple entries thus:
wolcmd 009027a324fe 195.188.159.20 255.255.255.0 8900
wolcmd 009024a731da 212.86.64.31 255.255.255.0 8900
To run the batch file, say half an hour before everybody gets into work, use the AT command on a Windows NT computer.
The AT command schedules commands and programs to run on a computer at a specified time and date. The Schedule service must be running to use the AT command. The syntax is as follows:
AT [\\computername] [ [id] [/DELETE] | /DELETE [/YES]]
AT [\\computername] time [/INTERACTIVE]
[ /EVERY:date[,...] | /NEXT:date[,...]] "command"
\\computername Specifies a remote computer. Commands are scheduled on local computer if this parameter is omitted.
id Is an identification number assigned to a scheduled command.
/delete Cancels a scheduled command. If id is omitted, all the scheduled commands on the computer are cancelled.
/yes Used with cancel all jobs command when no further confirmation is desired.
time Specifies the time when command is to run.
/interactive Allows the job to interact with the desktop of the use who is logged on at the time the job runs.
/every:date[,...] Runs the command on each specified day(s) of the week month. If date is omitted, the current day of the month is assumed.
/next:date[,...] Runs the specified command on the next occurrence of the day (for example, next Thursday). If date is omitted, current day of the month is assumed.
"command" Is the Windows NT command, or batch program to be run.
Example
wolcmd 00:1D:7D:22:DC:F0 192.168.1.86 255.255.255.128
wolcmd 001D7D22DCF0 192.168.1.86 255.255.255.128