installing oc8i extension in debian April 13, 2012
Posted by maxmil in : Uncategorized , add a commentAt the time of writing there are only the instantclient-basic and instantclient-sqlplus packages available in the debian repos.
Building the extension from source (using pecl) requires the instantclient-sdk package.
Since i could not find this for debian i used the rpm’s on oracles download site.
First convert them to deb’s using alien.
Then dpkg -i
Then pecl install oci8
Finally add the extension to the php.ini used by apache and reload apache.
Flex memory leaks and watching property chains September 7, 2011
Posted by maxmil in : Uncategorized , add a commentAs a general rule it’s a good idea to always unset any change watchers created via BindingUtils.bindProperty or Changewatcher.watch.
However in display objects this often requires a whole lot of boilerplate code listening for when your component is removed from the stage and even more if you consider that it might be re added at a later date.
Fortunately if you create a change watcher within your display object the scope of that change watcher is limited to the scope of the display object and so it doesn’t prevent the garbage collector from removing the object and watcher when the object is removed from the stage and you can avoid the boilerplate.
However whilst profiling my app today i have discovered that if your change watcher is listening to a property chain rather than a single property then this is not the case.
In this case multiple ChangeWatchers are created that reference each other and this, for some reason unknown to me, prevents the GC from collecting the ChangeWatchers and hence your display object.
Unfortunately in this case the boilerplate seems necessary
Love to hear if anyone could explain what is happening here…
/var/lib/dpkg/status and invalid character in revision June 27, 2011
Posted by maxmil in : Debian , add a commentThis error appears often in my system related to the names of virtualbox packages.
The current release of virtualbox packages no longer have this problem however the old packages are not removed from the status file.
The only solution seems to be to modify the status file by hand and remove the packages.
Another solution is to use this script written by Julien Valroff that clears purged packages from your status file.
Thankyou Julien.
Exclude hidden (dot) files from find June 8, 2011
Posted by maxmil in : Uncategorized , add a commentfind . -type f ! -iname ".*"
Using apt with an http proxy June 7, 2011
Posted by maxmil in : Debian , add a commentFirst export http_proxy environmental variable.
sudo export http_proxy=http://uname:pass@proxy:port
apt / aptitude will now use that proxy.
Setting up apache forward proxy with basic authentication
Posted by maxmil in : Uncategorized , add a commentTo set up an apache forward proxy with username password authentication you need to add something like this to a catch all virtual host. If apache is only listening on port 80 this would be your default virtual host.
ProxyRequests on
<Proxy *>
Order deny,allow
Allow from all
AuthType Basic
AuthName "Password Required"
AuthUserFile /etc/apache2/proxy.passwd
Require valid-user
</Proxy>
You must obviously have mod_proxy activated in your apache.
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_http_module modules/mod_proxy_http.so
To create the password file and add a user alice do
htpasswd -c /etc/apache2/proxy.passwd alice
Find out which process is listening on a given port May 9, 2011
Posted by maxmil in : Debian , add a commentIn GNU land, for port 123 this goes like
lsof -i :123
Or on Windows
netstat -aon | findstr 123 (get the process id)
tasklist | findstr processId
Move with wildcards December 30, 2010
Posted by maxmil in : bash , add a commentJust found problems with a directory of images that had some extensions in uppercase (JPG) and others in lowercase (jpg).
I wanted to move all the uppercase JPG to lowercase.
This is the script that did it:
for f in *.JPG
do
new=${f:0:${#f}-4}
mv $f ${new}.jpg
done
at, Cron for Windows November 24, 2010
Posted by maxmil in : Uncategorized , add a commentJust had to configure a scheduled task on a Windows server and have discovered a cron equivalent: at
At the command line typing “at” shows the programmed tasks.
To add a task use something like
at 02:00 /every:M,T,W,Th,F,S,Su c:\path\to\script.bat
Setting up SSL certificates for Chrome on Debian November 12, 2010
Posted by maxmil in : Uncategorized , add a commentJust a reminder of how to set up NSS shared DB that chrome uses on Linux for authenticating certificates.
First make sure that libnss3-tools are installed:
sudo aptitude install libnss3-tools
Then download the certificates for CAcerts
wget -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
wget -o "cacert-class3.crt" "http://www.cacert.org/certs/class3.crt"
Import them into the database
certutil -d sql:$HOME/.pki/nssdb -A -t "TC,," \
-n "CAcert.org" -i cacert-root.crt
certutil -d sql:$HOME/.pki/nssdb -A -t "TC,," \
-n "CAcert.org Class 3" -i cacert-class3.crt
What is this?
-d = where the database resides
-A = add action
-t = trust flags. In this case T identifies these certificates as certificate issuers any certificate issued by these authorites will be trusted. The C identifies the certificate as a root CA certificate. There are three different situations in which you can define trust flags: SSL, email and object signing. Here we just define the first one SSL.
-n = nickname
-i = certificate file
Lastly we can delete the downloaded files
$rm cacert-root.crt cacert-class3.crt