Ana içeriğe atla

Kayıtlar

Strange network share problem resolved

For some time I had a problem with a Windows 7 Home Premium computer when accessing to lan network shares. I was getting "0x80070035 network path was not found" or "0x80004005 unspecified error" messages while trying to access network shares on the same workgroup. I have made some research on web suggesting various solutions. It may be a firewall issue, or an issue about credential(s) manager. But lastly one other suggestion solved my issue. My problem was not those and it was about the missing feature "Client for Microsoft Networks" of my network card . Installing that feature resolved the issue.

Swf object z-index problem

When you have a swf object in your web page, some css menus, or other items might become hidden under the swf object. To solve this you might use the "transparent" attribute of the swf object's wmode property like this                     refer to   this   .

Renumbering id field of a database table

For a database I needed to renumber the existing id fields. Without using any auxiliary scripting language, here is a way to do it in mysql: say you want to number the id field begining from index 1000, set @count=999; update table set id=@count:=@count+1; as described in this page.

Merge Ps,Pdf Files and A4 into A5

I was trying to print man pages of OpenBSD. They were in .ps format and the paper size was a4. I wanted to convert the man pages so that two a5 pages lie onto an a4 page for the sake of being printer/environment friendly. I also want to combine them as a single document. Here are the commands 1) Making OpenBSD man file a .ps file mandoc -Tps /usr/share/man/man4/route.4 > route.ps 2)Converting 2 a4 pages into 2 a5 pages on a single a4 page psnup -2 -Pa4 -pa4 input.ps output.ps  This command converts 2 a4 pages into a5 ones and put them o a single a4 page. Magic isnt it? 3) Convert .ps files to pdf ps2pdf input.ps output.pdf 4) Combine .pdf files pdftk file1.pdf file2.pdf cat output outfile.pdf There is also a psmerge command. But it gave me some errors. So I chose converting them into pdf and then combining way. Ps: Here is a command for making 2 pages of a pdf file into one page: The package is called pdjam in Ubuntu pdfnup --nup 2x1 --outfile output.pdf ...

Php 5.1.6 json_encode

I was using Spiros Kabasakalis great ajax crud gii template for Yii on a server where PHP is of version 5.1.6. It was giving an error when one creates a new record. Some digging showed that it is because the 5.1.6 version does not include json library which is used in the template code. I installed the json library usein pecl, included ir in php.ini and voila. Meanwhile I have heard o another library upgradephp  which gives PHP 5.3/5.4 special properties to earlier versions of PHP. Now its time to enjoy Kabasakalis' library.

Python mechanize, beautiful soup and html scraping

I used to have bash,sed,awk,curl,beautifiul  soup  when I was doing html parsing,scraping and automating tasks. I was aware of mechanize but was not using it. Today I decided to give it a try for an automation task and I didnt regret. It was a real fun(!) learning(!) it. Actually I learned a bit of it. It helped me a lot on automating browser requests. Although I didnt yet use it for form handling, I know it has some magical power there too. I also realised that one must use Beautiful Soup with Mechanize. These make an awesome combo worth trying and using. Thanks to all the folks behind them. here is a snippet br = mechanize.Browser() br.open("http://www.site.com") all_links=[l for l in br.links(url_regex="pattern")] for i in all_links[5:]: br.follow_link(i) temp=br.response().read() soup=BeautifulSoup(temp)                                             ...

A Windows Vista tip

I was looking for a solution to a windows vista machine which dont login to a profile. Namely the profile was corrupt and the administrator account was not showing up when then system is started in safe mode. I tried some  suggestions by people on the internet. One of them stated that the administrator account in Vista is hidden to reveal it one needs to write this into a elevated command prompt net user administrator /active:yes Lets see if this helps to start this machine.