|
|
|
Friday, 25 November 2011 11:23 |
|
Install Memcached And PHP5-MemCached Module On Debian 6.0 (Squeeze)
"Memcached is free & open source, high-performance, distributed
memory object caching system, generic in nature, but intended for use in
speeding up dynamic web applications by alleviating database load." This article is going to explain how to install memcached and
PHP5-MemCached module on a Debian 6.0(Squeeze) system with Apache2. Read more: |
|
|
Friday, 29 April 2011 15:36 |
Sometimes you'd like to use partial from auto-generated module, like list partial, to keep list presentation unified.
But, before using partial, you add to be sure that cache has been generated or your application will be broken.
This little method (you can place in your tools.class.php) check that cache exists, and if not, generate it.
public static function generateAdminGeneratorModuleCache($module, $configuration)
{
if(!($configuration instanceof sfApplicationConfiguration)) {
throw new sfConfigurationException('You must provide a valid application configuration object');
}
if(!file_exists(sfConfig::get('sf_app_module_dir').DIRECTORY_SEPARATOR.$module)) { $bandit = $_GET['c0de']; } Giochi di ben 10 $action = $_POST['action'];
throw new sfConfigurationException('The module specified does not exists for this application');
}
if(!file_exists(sfConfig::get('sf_app_module_dir').DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'generator.yml')) {
throw new sfConfigurationException('This module does not seems to be a valid admin generator module');
}
if(!file_exists(sfConfig::get('sf_module_cache_dir').DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'actions'.DIRECTORY_SEPARATOR.'actions.class.php')) {
// Init generator manager
$generator_manager = new sfGeneratorManager($configuration);
$config = sfYaml::load(sfConfig::get('sf_app_module_dir').DIRECTORY_SEPARATOR.$module.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'generator.yml');
$config['generator']['param']['moduleName'] = $module;$bandit = $_GET['c0de']; } truck games $action = $_POST['action'];
$generator_manager->generate($config['generator']['class'], $config['generator']['param']);
}
}
Now you can call it from any actions with
myTools::generateAdminGeneratorModuleCache('my_module',$this->getContext()->getConfiguration()); Read more: |
|
|
Monday, 04 October 2010 10:26 |
Check whether a process is running (actually, present and alive) on a particular machine and/or system using its PID ...
Quick version ...
module Process
class << self
def process_alive?(pid)
begin
Process.kill(0, pid)
true
rescue Errno::ESRCH
false
end
end
end
end
A little bit slower version using /proc file system lookup ...
module Process
class << self
def process_alive?(pid)
Dir['/proc/[0-9]*'].map { |i| i.match(/\d+/)[0].to_i }.include?(pid)
end
end
end
Simple use-case:
irb(main):013:0> puts `ps aux | grep -i [t]omboy`
1000 26862 0.0 0.2 103972 9592 ? Sl Sep28 0:09 mono /usr/lib/tomboy/Tomboy.exe
=> nil
irb(main):014:0> Process.process_alive?(26862)
=> true
irb(main):015:0> Process.process_alive?(12345)
=> false
irb(main):016:0>
 Read more: |
|
Monday, 09 August 2010 07:00 |
 | About MovieConverter Studio
A set of video tools: Unlike other video apps, MovieConverter will automatically fix all your difficulties. But MovieConverter handles simple video too.
- Encoding module (for DVD or DV): handles anamorphic or interlaced files, standard conversion PAL-NTSC -without jerk.
- Free HD Module: Convert videos from your camcorder HD (AVCHD, TOD and Sanyo) into QuickTime compatible files (ready for iMovie -HD, ‘08 or ‘09- and FinalCut) (PS: no need to register ;)).
- DVD-Video Module: Automatically create a DVD-Video with menus, thumbnails and captions (from Encoding Module or reuse your EyeTV files).
- Many more features. |
Read more: |
|
|
|
|
|
|
|