C# csc.exe Environment Variable
environment variable->add new:
name: cs
value: C:\WINDOWS\Microsoft.NET\Framework\[VERSION]\csc.exe
use:
C:\>%cs% example.cs
PHP Extend Session Timeout
Edit session.gc_maxlifetime param in php.ini file:
session.gc_maxlifetime = 1440
MySQL UPDATE By SELECT
UPDATE by SELECT example:
UPDATE [table0_name] AS T0, [table1_name] AS T1
SET T0.[field0_name]=T1.[field1_name]
WHERE T0.[field0_id]=T1.[field1_id]
Ubuntu Save Alias
Ubuntu (9.04) Edit /etc/bash.bashrc
Add alias lines:
alias z='ls -l'
Logout/login to save/use
Ubuntu Symbolic Link
ln -s
From /var/www/example2:
#ln -s /var/www/example/httpdocs httpdocs
To remove link, delete directory/file
Disabling open_basedir Restriction
<Directory /var/www/vhosts/example_2.com/httpdocs>
php_admin_value open_basedir "/var/www/vhosts/example_2.com/
httpdocs:/var/www/vhosts/example.com/httpdocs:/tmp"
</Directory>
ORDER BY IN Value
Query will order results by newest tasks first with exception that any task 100% complete will be displayed last
SELECT *
FROM tasks
ORDER BY task_percent_complete IN(100) ASC, task_datetime DESC
Add Ubuntu Directory Index
Add directory index to:
/etc/apache2/mods-enabled/dir.conf
<IfModule mod_dir.c>
 DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
</IfModule>
Ubuntu Logrotate
Create logrotate file /etc/logrotate.d/example
/var/log/webserver/barsupply.log {
daily
rotate 7
missingok
compress
notifempty
#olddir will change log archive directory (not required)
olddir /var/log/example/archive
}
Register logrotate file:
#logrotate -f /etc/logrotate.d/example
View file status in logrotate:
/var/lib/logrotate/status
