Visual C# Upload File/Image via PHP with Squid-Cache in the Network

Info.Tech, Linux System Administration, PHP, Software Development, Visual C# View Comments

Today, I’ve been developing an oDesk-like activity monitoring application but for local network for my company, Innermax Support, and I came across with a problem of an errors:

  • An exception occurred during a WebClient request.
  • The remote server returned an error: (417) Expectation failed.

And during my search in Google — from forums, MSDN and other developers’ resources — they face same problem. The common issue was the 100-Continue problem passing to a network with squid-cache. So there’s a websites that I combined their codes and luckily it works. Just forgot the URLs, I can’t credit thank-you’s to them.. hehehe!

The setup is like this… there’s a firewall which has squid-cache in the local network and my server where I will upload my file/image is at the other network with public IP address. I will directly upload the file/image to my server using the assigned public IP address via PHP script.

Here’s my code to solve the problems;

public void uploadFile()
{
    try
    {
        // decleration of webclient
        ServicePointManager.Expect100Continue = false;
        System.Net.WebClient webby = new System.Net.WebClient();

        //initiate credentials
        webby.UseDefaultCredentials = false;
        webby.Credentials = new NetworkCredential("anonymous", "");

        //add headers
        webby.Headers.Add(HttpRequestHeader.UserAgent, "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.832)");
        webby.Headers.Add("Content-Type", "binary/octet-stream");

        //initiate upload file
        Byte[] result = webby.UploadFile("http://120.0.0.1/upload.php", "POST", @filename);

        string s = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
        MessageBox.Show(s);
        webby.Dispose();
    }
    catch (Exception)
    {
        // do nothing...
        MessageBox.Show("Upload failed!");
    }
}

So far, it works fine with me and satisfied of my solution. Hope this will help your problem too… :)

DUMP/JUNK/TRASH SOPA/PROTECT-IP

Madness, Personal View Comments

PROTECT IP / SOPA Breaks The Internet from Fight for the Future on Vimeo.

Tell Congress not to censor the internet NOW! – fightforthefuture.org/pipa

PROTECT-IP is a bill that has been introduced in the Senate and the House and is moving quickly through Congress. It gives the government and corporations the ability to censor the net, in the name of protecting “creativity”. The law would let the government or corporations censor entire sites– they just have to convince a judge that the site is “dedicated to copyright infringement.”

The government has already wrongly shut down sites without any recourse to the site owner. Under this bill, sharing a video with anything copyrighted in it, or what sites like Youtube and Twitter do, would be considered illegal behavior according to this bill.

According to the Congressional Budget Office, this bill would cost us $47 million tax dollars a year — that’s for a fix that won’t work, disrupts the internet, stifles innovation, shuts out diverse voices, and censors the internet. This bill is bad for creativity and does not protect your rights.

Biden on Internet Freedom = Anti-SOPA from Fight for the Future on Vimeo.

americancensorship.org

Joe Biden filled in for Hillary Clinton at the London Conference on Cyberspace (LCC) on November 1st, giving a speech on the importance of freedom in cyberspace and talking up the importance of freedom on the internet and not regulating the internet. Meanwhile, the Obama Administration stands with congress in full support of H.R 3261, the Stop Online Piracy Act, which would give copyright holders the ability to censor websites on the net. We need to stand up now and let Congress know that they shouldn’t mess with the Internet!

[REPOST] 7 Ways To Fail When Outsourcing To The Philippines by John Jonas

Info.Tech, Madness, Personal View Comments

My co-worker sent me a link and found it very true of most of the employers in Online Jobs. They maltreated Filipinoes as their virtual assistant, they want to do everything and finish it in a day or hour or a second. And I found it as stupidity tasks coz we are not Superman! I would like to re-post this good article by John Jonas.


When it comes to outsourcing your business (or yourself!) to the Philippines, there’s definitely a learning curve.
Here are 7 ways you can guarantee failure for yourself :
(Hint: Don’t do these things!)

1. Try To Hire Someone To Do Everything

Here’s an actual email I got this week

So wait…you want a programmer, graphic designer, webmaster, who is fluent in english and likes to write, who can write sales copy, autoresponders, forum posts, ebooks, and reports.
Oh yeah, sure, let me help you find that person!
Oh wait, that person doesn’t exist.
Hire someone to do a specific task! Then train them to be able to do everything.

2. Hire A Project Manager

Filipinos don’t know how to run your business for you.
Don’t try to hire a project manager first along with 6 others, and expect that “project manager” to manage those other 6 and get things done. They don’t know how.
YES! They’re very capable of being project managers, but very rarely will you find someone who has been involved in enough internet business that you can just turn a project over to them and have them manage other people for you.
Eventually…yes! After you’ve trained them and they’ve seen how the business is supposed to work.

3. Hire Someone And Ignore Them

You have to train the person you hire. They don’t know how to run your super-niche internet marketing business. Don’t expect to hire someone and just let them go do everything themselves. Expect to spend some time working with them.

4. Ask Someone To Do Work Before You Offer Them A Job

This is my favorite.
I get an email that says

Can you please tell me why I can’t successfully hire someone, they all keep disappearing.
Here’s the email I send them:
I want you to start by doing a trial task.
Write 20 articles, submit them to article directories, do a bunch of directory submissions for me, build me a website and write all the content for it.
Then, I’ll evaluate your work and see if it’s going to work out.

hahahahaha.
Yeah right!
They’re not going to do work until AFTER they know they have a full-time job working for you.
Don’t give them a test task. Give them a job. Tell them the first month is a probationary period.

5. Expect Immediate Results

This is a long-term proposal here. I’ve been doing it for 4 years. You’re not going to see the same results in 4 days.
Don’t expect it.

6. Search and Search and Search For The Right Person, Then Email Them

Hey John,
I searched for 3 days and I found the perfect candidate. They can do everything you said wasn’t possible back up in #1 on this blog post. Why won’t they respond to me?

Why?
Because they already have a job and they’re loyal to their current employer.
Instead of trying to find the perfect person up front, try contacting 20 potential fits, see who responds, then sort through them.

7. Set The Wrong Expectations

When you hire them, don’t tell them you expect them to be totally self-directed and to work without supervision and to be able to figure everything out on their own.
If you do, you’ll never hear from them again.
Try telling them

I expect you to try to figure things out, but I understand that I’m going to give you tasks that you won’t know how to do, and sometimes there won’t be any way to figure it out. In these cases, please know that I’m here to answer your questions. I’m here to help you. Please don’t hesitate to ask me when you get stuck.

Otherwise, when they don’t know how to do something they get embarrassed and will never talk to you again.
If you set the right expectation with them about asking for help, they’ll ask, you’ll help, and all will be happy and good.

These aren’t hard things to avoid…you just have to know about them to avoid them.
There’s more good stuff like this as a member of ReplaceMyself.com.


Author: John Jonas

Article Reference: http://www.jonasblog.com/7-ways-to-fail-when-outsourcing-to-the-philippines

Outsourcing in the Philippines: InnerMax Support

Administration, Info.Tech, Learn New Things, Linux System Administration, Personal, PHP, Web Development View Comments

InnerMax SupportI’ve crossed  a good outsourcing firm in the Philippines, Innermax Support specializes in Web Development, Web Designing, SEO Services, Data Entry, Social Media Marketing, Inbound Phone Support, Outbound Phone Support.

They are comparatively new to the industry, but with their management along with all their agent’s combined knowledge, skills, and significantly valuable experiences; they surely can consistently turn every single task, great or small, highly distinguished more than any clients could wish for.

  • Innermax Support provides high quality services
  • Takes your business outsourcing to a new level with more leads and sales
  • Endows with the best services way beyond your desired results and expectations
  • Has assigned the best agents that fit every campaign you asked to be dealt with.
  • Gladly welcomes high level of engagement with the corporate stakeholders at your company.

Expect Quality Services

  • Exceptional results and return on assets
  • They never fail to keep our eyes peeled towards particular outcomes and circumstances of your campaign and in most instances; they most likely notice any sorts of any diversities and take action before such gets out of hand.
  • They are firmly committed to quality service and accommodation.
  • They are very knowledgeable by every inch and corners from tiniest to most immense aspects about e- marketing.
  • They never would hesitate to establish bountiful relationship and develop harmonious companionship with their valuable clients.
  • They live by the virtue of courteous and respectful demeanor to each of their clients.
  • They never would leave their clients oblivious about any current status of the relayed tasks.
  • And above all. They walk what they talk.

HowTo? .htaccess SEO-friendly URL

Administration, Info.Tech, Linux System Administration, PHP, Web Development View Comments

Today, its my 3rd time I created a SEO-friendly URL for a website… and its been a year since my last setup and forgot the procedure.. So I’m writing it down to my blog to remind me what I did… this time, I used different method coz I’m getting lazy using regex. hehehehe…

I used .htaccess generator at www.myseotool.com and upload to the server.. I tested it out.. and it seems it won’t work…

I search for the solution and I found the solution of Eddie Ringle about his experience too. So I edited my httpd.conf , since I’m also the system/server administrator, I have full access on the server, and change from;

<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>

to

<Directory />
  Options FollowSymLinks
  AllowOverride All
</Directory>

then save httpd.conf new changes. Then restart httpd or apache. then I tested it out..

…or other way that might cause the problem is, your mod_rewrite.so module in not enable. to do this, edit your httpd.conf;

from

#LoadModule rewrite_module modules/mod_rewrite.so

change to

LoadModule rewrite_module modules/mod_rewrite.so

wallah! it works!

Party in the CIA

Entertainment, Funstuff, Music View Comments

Watching and listening the lyrics makes me laugh…

Just want to share.. :)

Developer’s MySQL Auto-backup for Windows

Info.Tech, Software Development, Visual C# View Comments

2 days ago, my 7 years old computer motherboard, Intel Desktop Board DP965LT Classic series, died and as I replace with Intel Desktop DG31PR, I experienced with disturbing incident in MySQL databases. It got corrupted, some of the tables of .MYI and .MYD of the databases are missing. I tried to recover using REPAIR TABLE command in MySQL, got not luck. I tried using Stellar Phoenix Database Recovery for MySQL don’t work well at all. So it means that I cannot recover my lost databases.

So I developed a software which protect my databases, this is to auto-backup all my MySQL databases to other drive or user-defined backup location. This application is for Windows XP, I haven’t tested it in Windows 7 and other Windows OS yet. :) I called this software as “Developer’s MySQL Auto-backup“.

The software is freeware or just totally FREE. You can use it but of course no warranty. :P

Enjoy my software… :)

Gambas 2.x in Ubuntu

Gambas, Info.Tech, Operating Systems, Software Development View Comments

Its been a while that I’m not using Linux especially Ubuntu. While reading in CDO Information Technology Group in facebook, one person ask about an opensource similar to visual basic and somebody answer that use GAMBAS. So I searched and found GAMBAS and its samples. I’m getting curious more. So install VMware 7.1 and downloaded Ubuntu 11.04. Also installed right away the GAMBAS after the OS installation.

 

Installing GAMBAS 2.x
Installing GAMBAS 2.x in Ubuntu

So after installation, as a first app — the “Hello World!”. so I start creating a new project and test typing lil’ codes. Coding results below;

 

GAMBAS First App

GAMBAS First App

Conclusion: GAMBAS is just like MS Visual Basic with some little differences in coding. Hope GAMBAS will be fully developed and become mature, with this Linux Desktop Application Developer will raise (and I want to be one of the developers! hahahaha…).

Comments: I like GAMBAS.. so cute! hahahahaha… want to explore more about this software.

For more information about GAMBAS, please visit http://gambas.sourceforge.net/en/main.html

 

SEO Fart | XML-RPC Ping Tool

Info.Tech, Software Development, Visual C# View Comments

As my latest creation which boost me up to create this desktop application are my SEO staff which they have been searching for a good ping tool for their SEO. So instead of buying a software, I created my own and let them use it for their SEO campaign. I call it XML-RPC Ping Tool and under a brand name of SEO Fart because most of us always fart in the office. Hahahhahaha!

XML-RPC Ping Tool – A made-easy tool that poke Search Engines via ping service websites that your blog or website has been updated. Capable of mass URL pinging and scheduled URL pinging to make your SEO tasks easy and fast.

However, in the office the application is for free but to other people, its for sale. Sweat and effort must be paid of course. :)

MySQL 5.5 changing data folder

Administration, Info.Tech, Operating Systems View Comments

Today, I’m having problem with my MySQL. I bought new computer and want to transfer my databases from my old PC (using winXP) to new PC which is using windows 7. When I copied all my databases from data folder from my old computer and paste it to my new PC at “C:\Program Files\MySQL\MySQL Server 5.5\Data”, and restart the MySQL, I can’t see my databases. I found a solution from www.fossplanet.com and here’s the step (I slightly modified the step since i have different problem…)

  1. create folder in “C:\MySQLData”
  2. copy all files from “C:\Users\All Users\MySQL\MySQL Server 5.5\data” to “C:\MySQLData”
  3. go to RUN and type services.msc and stop MySQL service
  4. at “C:\Program Files\MySQL\MySQL Server 5.5″ — edit the my.ini and change the datadir value to your new MySQL data folder which is “C:/MySQLData/”
  5. after changing the datadir, at Services window (services.msc) start again your MySQL
  6. then cast command in MySQL CLI “show databases” and you should get your migrated databases showing… :)

 

——————-

thanks to:

Rolando A. Edwards
MySQL DBA (SCMDBA)

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in