Mounting a shared folder with spaces in ubuntu
June 12, 2009
Ok after much dancing around with google searches. I figured this one out on my own. Mounting a shared folder with spaces can be a bitch. But after this it should be easy.
ok so lets say you have a folder that’s shared on the network called “My Shared Drive” for example. Now on your ubuntu box you want to mount that to a folder on your local machine. Normally you would do this.
sudo mount -t cifs //<ip address>/folder name /home/user/ -o username=name,password=pass
However since there is a space in the folder name it was giving me an error. And using \040 wasn’t working to simulate the space.
sudo mount -t cifs “//<ip address>/folder name” /home/user/ -o username=name,password=pass
I had to encapsulate the line in between “quotes” to get it to work. After I did that it worked perfectly and mounted the dir.
Inserting a PDF into a MSQL database with PHP
April 9, 2009
I have in the past inserted images and other binary data into a MYSQL database using PHP with no problems. However now at my current job we needed to insert PDF’s into a MSQL server. Unfortunately google turns up relatively little searches on inserting binary data into MSQL database via PHP. Luckily after doing some serious research I’ve found a solution that works.
Lucidux-SansOblique open type font and editing pdf documents created with pdflib
November 10, 2008
For those of you php programmers using the pdflib package for creating pdf’s. Sometimes you find that you need to edit your pdf’s. Well at least I find that I do. I’ve just about killed myself trying to find the font called lucidux-SansOblique. Luckily I’ve found it!
Normally when using pdflib on a linux machine the fonts used are type 1 fonts and not true type fonts. Trying to edit a pdf on your windows box results in a font not found error. This is majorly annoying. And trying to find the font online can be a major headache. Luckily enough I found the Lucidux-SansOblique font online and I put it on Free Font View under Lucidux-SansOblique so that others can use the font too. I hope this helps others searching for this font.
PHP Array Sum
July 10, 2008
I was needing to sum all the values in an array today. I was about to make my own function to do this when I found out that PHP has a built in function called array_sum that does that for you.
PHP Date Function and Formatting a Date
March 27, 2008
The other day someone asked me how to format a date pulled from a MySQL dbase. I do this all the time however a friend was asking the question so I decided to blog about it as well. It comes up alot in programming so I figured it might be of use to someone else. Read on.
Stripping text from the alt tag of a webpage with regex
March 13, 2008
The other day my fiance needed to get some info from a webpage that was in the alt tags. I decided to write up a script that would do it in php.
I’m not the best at regular expressions so I had to look up on the web on how to do it. Regex is a pain to understand. But if you work at it you start to realize how much power it has.
So without much further ado here is the regex, that suited me for this situation, to find out the text that’s in the alt tags of a webpage.
Pwning lame ass dupes in excel
February 12, 2008
Well a friend wrote some bitching code. So we thought we should share.
‘much faster dup remover but has dependencies and preparations:
’1. there must not be over 500 dups of a certain thing, this will only
‘ remove up to 500 dups of each item, must run again if more
’2. you are required to order the table based on column 1
’3. column 1 is the only field checked
’4. only deletes the cell instead of row to keep in order.
’5. re-sort table based on column 1 and remove all rows with empty first cell
’6. add THEEND to first cell of a row at the bottom so dup checker
‘ will stop once it gets there
Application.ScreenUpdating = True
Dim x As Long
Dim y As Long
For x = 1 To 59999
Sheets("Sheet1").Cells(x, 1).Select
If Sheets("Sheet1").Cells(x, 1).Value = "THEEND" Then
MsgBox "Done!"
Exit Sub
End If
If Not x = 59999 Then
For y = (x + 1) To (x + 500)
If Not Sheets("Sheet1").Cells(y, 1).Value = "" Then
If Sheets("Sheet1").Cells(y, 1).Value = Sheets("Sheet1").Cells(x, 1).Value Then
Sheets("Sheet1").Cells(y, 1).Value = ""
DoEvents
Sheets("Sheet1").Cells(x, 1).Select
End If
End If
Next y
End If
Next x
MsgBox "Done!"
End Sub


