archive-ca.com » CA » D » DEFUNCT.CA

Total: 226

Choose link from "Titles, links and description words view":

Or switch to "Titles and links view".
  • boompty boomp | Page 7
    error messages for Posted on July 19 2008 by admin I m using restful authentication on a site I m writing well converting from PHP to rails and initially had this in app views users new rhtml error messages for user The problem here was that it d spew out a billion errors if someone submit the form without entering any fields I ve since removed that line and added the following to app views users new rhtml user errors full messages first Now it only prints the first error as opposed to all of them if there are multiple This looks a little less overwhelming and is easier to format On a side note you ll probably want to check that users errors exists before trying to display the contents Posted in Ruby on Rails Leave a comment postfix MySQL support on RHEL 5 Posted on July 18 2008 by admin If you re running RHEL 5 and need postfix built w MySQL support you can use the CentOSPlus Repository package found here This is not an ideal solution as it s not a Red Hat package but would save you having to rebuild Red Hat s source package to get MySQL support More information this repository can be found here Edit Numerous people have requested that Red Hat add MySQL support to postfix in this Red Hat bugzilla bug but it seems Red Hat are reluctant to add the support as it d add an extra dependancy to postfix People have stated that the same dependancy already exists for dovecot so I m not sure what the holdup is Posted in Linux Tagged centos mysql postfix Leave a comment scp umask Posted on July 18 2008 by admin From what I ve seen scp treats a shell user s umask slightly differently Basically if you set the umask on the remote side to 002 and then scp a file over that has a perm of 644 then it will take on the same perm of 644 on the remote side However if you send a file across with a perm of 666 the file should take on a perm of 664 on the remote side So it will subtract bits but not add them Posted in Linux Tagged openssh Leave a comment VNC server on CentOS 4 5 Posted on July 7 2008 by admin First off install the following packages yum install vnc server xorg x11 xorg x11 twm xterm When done modify etc sysconfig vncserver and uncomment VNCSERVERS specifying a user for vncserver to run under Save the file su to the user specified and run vncpasswd Exit that shell returning to root and then sbin chkconfig vncserver on etc init d vncserver start If you wish to use GNOME instead of TWM install gnome session yum install gnome session Finally modify vnc xstartup in the user s home directory that vncserver runs under and change this line twm to gnome session Things seem slightly different

    Original URL path: http://blog.defunct.ca/page/7/ (2015-04-05)
    Open archived version from archive


  • admin | boompty boomp | Page 6
    RewriteEngine on RewriteRule panel https HTTP HOST 8443 L Now if only I could figure out why this Continue reading Posted in Linux Tagged apache Leave a comment STDIN Posted on August 18 2008 by admin You can use STDIN like this to have ruby read from standard input usr bin ruby w input STDIN input each line puts line You can then do something like cat etc hosts ruby stdin2stdout rb Posted in Ruby Leave a comment Running two instances of Apache on one machine CentOS Posted on August 12 2008 by admin I haven t put this into production but I tested it and it seems so far to work OK First off cp a etc httpd etc httpd2 cp a etc init d httpd etc init d httpd2 cp a etc sysconfig httpd etc sysconfig httpd2 ln s usr sbin httpd usr sbin httpd2 Continue reading Posted in Linux Tagged apache centos Leave a comment xen Posted on August 11 2008 by admin So one of my dislikes w xen was that I couldn t get any of the www jailtime org images to work and I had no idea how to create non CentOS images After having a look at the man page for virt install I Continue reading Posted in Linux Tagged xen 1 Comment rescue from Posted on August 4 2008 by admin So I was updating a few controllers to trap exceptions using something like begin event Event find params id rescue ActiveRecord RecordNotFound flash error Event not found redirect to action index end This worked fine but didn t seem to be overly DRY Googling Continue reading Posted in Ruby on Rails Leave a comment flash notice flash error again Posted on July 27 2008 by admin So I ve ended up

    Original URL path: http://blog.defunct.ca/author/admin/page/6/ (2015-04-05)
    Open archived version from archive

  • Linux | boompty boomp | Page 6
    2008 by admin telnet 0 143 Trying 0 0 0 0 Connected to 0 Escape character is OK dovecot ready a login user password a OK Logged in telnet quit Connection closed Replace user and password with the user details you Continue reading Posted in Linux Leave a comment Block sizes Posted on June 9 2008 by admin Using Linux you can specify the filesystem s block size when creating the filesystem Running as an example tune2fs l dev hda1 grep Block size will show you what block size was used when the filesystem was created On Continue reading Posted in Linux Leave a comment Threads Posted on June 9 2008 by admin To see which threading library your Linux system is using run getconf GNU LIBPTHREAD VERSION On RHEL 4 the default threading library is NPTL To temporarily use linuxthreads set your LD ASSUME KERNEL environment variable LD ASSUME KERNEL 2 4 19 rpm rebuilddb More information on this Continue reading Posted in Linux Leave a comment inodes Posted on June 9 2008 by admin The number of inodes an ext3 filesystem can support is defined at filesystem creation time A while back we had a box that had run out of inodes and therefore was unable to create any new files directories Doing a df Continue reading Posted in Linux Leave a comment tmp noexec Posted on June 9 2008 by admin If you want to mount tmp with the noexec option typically this would require a dedicated partition for tmp However using this method will allow you to do this without having a dedicated tmp partition mount o bind tmp Continue reading Posted in Linux Leave a comment Renaming an LVM volume group Posted on June 9 2008 by admin This had to be done for a

    Original URL path: http://blog.defunct.ca/category/linux/page/6/ (2015-04-05)
    Open archived version from archive



  • boompty boomp | Page 8
    x a first b second a first b second irb main 012 0 x keys a b irb main 013 0 x values first second irb main 014 0 x each key value puts key key value value key a value first key b value second a first b second irb main 015 0 Something that confused me tonight is passing code blocks to methods I ll need to have another look when I m slightly less brain dead and on my previous post about bash sequences something similar in ruby A z to a each l puts l to a converts a range into an array I could see this being handy if you wanted to scan through something one letter at a time like this x File open etc passwd r a z to a each do l count 0 x each do line count 1 if line l end puts l count to s if count 0 x pos 0 end x close x pos here sets the file position back to 0 so I don t need to constantly close and re open the file to scan through it On a side note if you do something like this File open etc passwd line puts line you don t have to explicitly close the file as it ll be done automatically Also no need to explicitly specify r open it for reading as that is the default Posted in Ruby Leave a comment bash sequences Posted on June 16 2008 by admin I always did them this way for x in seq 1 10 do echo x done However you can actually do them this away also for x in 1 10 do echo x done You just never know when seq s going to magically disappear and you need some critical sequences Posted in Linux Tagged bash Leave a comment Difference w each and collect Posted on June 15 2008 by admin Nothing fancy here irb main 001 0 a 1 2 3 4 5 1 2 3 4 5 irb main 002 0 c 0 0 irb main 003 0 a each b print b 1 2 3 4 5 1 2 3 4 5 irb main 004 0 I guess the cool thing w collect is that you can easily create another array based on some expression in the code block irb main 001 0 a 1 2 3 4 5 1 2 3 4 5 irb main 002 0 c a collect b b b 1 4 9 16 25 irb main 003 0 a inspect 1 2 3 4 5 irb main 005 0 c collect 1 4 9 16 25 irb main 006 0 Posted in Ruby Leave a comment Loops Posted on June 15 2008 by admin Some neat ways w ruby irb 1 main 003 0 5 times print heh heh heh heh heh heh 5 irb 1 main 004 0 1 upto 5 x print x 1

    Original URL path: http://blog.defunct.ca/page/8/ (2015-04-05)
    Open archived version from archive

  • admin | boompty boomp | Page 7
    an ideal solution as it s not a Red Hat package but would save you having to Continue reading Posted in Linux Tagged centos mysql postfix Leave a comment scp umask Posted on July 18 2008 by admin From what I ve seen scp treats a shell user s umask slightly differently Basically if you set the umask on the remote side to 002 and then scp a file over that has a perm of 644 then it will take Continue reading Posted in Linux Tagged openssh Leave a comment VNC server on CentOS 4 5 Posted on July 7 2008 by admin First off install the following packages yum install vnc server xorg x11 xorg x11 twm xterm When done modify etc sysconfig vncserver and uncomment VNCSERVERS specifying a user for vncserver to run under Save the file su to the user specified and run Continue reading Posted in Linux Tagged centos 1 Comment vsftpd w MySQL users on CentOS 5 2 Posted on July 7 2008 by admin Although not written for CentOS I used this which worked pretty well The only issue I had was that my etc my cnf contained old passwords 1 and it was looking for the new password scheme when configuring etc pam d vsftpd with crypt 2 mysql Setting the Continue reading Posted in Linux Tagged centos mysql Leave a comment Automatic creation of vhost conf files on Plesk Posted on July 2 2008 by admin It s quite straight forward Create the directory var www vhosts skel 0 conf and then create a file called vhost conf in it containing something like this directory var www vhosts vhosts domain name httpdocs php admin value open basedir var www vhosts domain name tmp directory The domain being provisioned here gets referenced as

    Original URL path: http://blog.defunct.ca/author/admin/page/7/ (2015-04-05)
    Open archived version from archive

  • boompty boomp | Page 9
    gender irb main 003 1 end nil irb main 004 0 person instance Person new person 0xb7ee9aa0 irb main 005 0 person instance name Matt Matt irb main 006 0 puts person instance name Matt nil irb main 007 0 person instance location London NoMethodError undefined method location for person 0xb7ee9aa0 name Matt from irb 7 from 0 irb main 008 0 As there is no location attribute defined an error is generated when I try to set this instance Posted in Ruby Leave a comment wp syntax Posted on June 14 2008 by admin I ve tried a few WordPress plugins to properly format shell output and the best I ve found so far is wp syntax I simply use lang as using lang bash doesn t work for me since I use a hash to represent the shell prompt Anyway I noticed a problem where using a pipe doesn t display correctly and looking at the page s HTML source the pipe seems to get replaced with PIPE Obviously the browser doesn t render that and no pipe is displayed Looking through wp content plugins wp syntax I noticed str replace in geshi geshi php that seems to replace with PIPE I guess it should get replaced again at a later stage but something seems broken I ve since changed this code in geshi geshi php from result str replace array semi pipe array result aTransSpecchar array amp quot lt gt This fix is related to SF 1923020 but has to be applied regardless of actually highlighting symbols Circumvent a bug with symbol highlighting This is required as would produce undesirable side effects if it was not to be processed as an entity semi Force to be processed as entity pipe Force to be processed as entity ENT COMPAT set To result str replace array semi pipe array result aTransSpecchar array amp quot lt gt This fix is related to SF 1923020 but has to be applied regardless of actually highlighting symbols Circumvent a bug with symbol highlighting This is required as would produce undesirable side effects if it was not to be processed as an entity semi Force to be processed as entity pipe Force to be processed as entity ENT COMPAT set This seems to that fix the immediate problem while probably breaking something else as per the comments Posted in Wordpress 1 Comment monit Posted on June 13 2008 by admin I just installed monit on my Linode VPS and enabled this nice feature in etc monit conf set httpd port 2812 and use address localhost allow localhost allow admin monit I haven t even looked at the interface through a browser but what I like is that I can now type monit status etc and get output to the console about the status of services httpd memory CPU usage service uptime etc If you d like to try it grab the source from here or the RHEL CentOS RPMs from here Posted in Linux

    Original URL path: http://blog.defunct.ca/page/9/ (2015-04-05)
    Open archived version from archive

  • admin | boompty boomp | Page 8
    seeing key value blocks when having a look at Ruby on Rails and thought I d make a note for future reference irb main 011 0 x a first b second Continue reading Posted in Ruby Leave a comment bash sequences Posted on June 16 2008 by admin I always did them this way for x in seq 1 10 do echo x done However you can actually do them this away also for x in 1 10 do echo x done You just never know when seq s going Continue reading Posted in Linux Tagged bash Leave a comment Difference w each and collect Posted on June 15 2008 by admin Nothing fancy here irb main 001 0 a 1 2 3 4 5 1 2 3 4 5 irb main 002 0 c 0 0 irb main 003 0 a each b print b 1 2 3 4 5 1 Continue reading Posted in Ruby Leave a comment Loops Posted on June 15 2008 by admin Some neat ways w ruby irb 1 main 003 0 5 times print heh heh heh heh heh heh 5 irb 1 main 004 0 1 upto 5 x print x 1 2 3 4 5 1 irb 1 main 005 0 1 step 5 2 x print x Continue reading Posted in Ruby Leave a comment Grabbing usernames from etc passwd Posted on June 15 2008 by admin Two ways of doing it file File open etc passwd r file each do x y x match w puts y 1 end file close file File open etc passwd r file each do x y x split puts y 0 end file close The second Continue reading Posted in Ruby Leave a comment String length Posted on June 15 2008 by admin

    Original URL path: http://blog.defunct.ca/author/admin/page/8/ (2015-04-05)
    Open archived version from archive

  • boompty boomp | Page 10
    Block count by Block size and then divide that value by Inode Count we get roughly 8192 bytes This means that for every 8192 bytes two blocks an inode is created To create a filesystem with more inodes you can pass the i option to mke2fs with a lowered bytes value Posted in Linux Leave a comment tmp noexec Posted on June 9 2008 by admin If you want to mount tmp with the noexec option typically this would require a dedicated partition for tmp However using this method will allow you to do this without having a dedicated tmp partition mount o bind tmp tmp mount o remount bind nosuid tmp tmp Done and done Posted in Linux Leave a comment Renaming an LVM volume group Posted on June 9 2008 by admin This had to be done for a client as it cannot be done while the box is online To test on my CentOS virtual machine I booted off a rescue CD and with the disks unmounted did lvm vgscan There s no vgscan vgchange vgrename commands in the rescue environment but there s an lvm wrapper lvm vgrename VolGroup00 vg001 lvm vgchange a y I couldn t see dev vg001 until I ran this mount dev vg001 root somewhere mount dev sda1 somewhere boot At this point etc fstab and etc grub conf were accessible and could be modified to replace the old volumge group name with the new one mount o bind sys somewhere sys mount o dev dev somewhere dev mount o proc proc somewhere proc Finally I had to rebuild the initrd image after backing it up of course chroot somewhere mkinitrd v initrd 2 6 18 53 1 13 el5 img 2 6 18 53 1 13 el5 Quite straight forward but

    Original URL path: http://blog.defunct.ca/page/10/ (2015-04-05)
    Open archived version from archive