Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused

Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection

refused

Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:111

Connection refused

Plotseling doet je mongodb het niet meer en krijg je deze melding te zien.n< !–more –>

Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connectionnrefused

Een simple maar doeltreffende oplossing is om de volgende 3 regels op jenterminal te runnen.

1n2n3n
sudo rm /var/lib/mongodb/mongod.lock  nmongod --repair  nsudo service mongodb startn

Let op: je kan het beste uitzoeken waarom je deze foutmelding krijgt:
n“Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connectionnrefused” en proberen dit op te lossen.

De oplossing die ik hier boven geef is dus geen oplossing voor de langerentermijn en ik een echt nette oplossing is het niet.

Maar als je Mongodb snel weer op de been wilt hebben dan kan dit voor even denoplossing zijn.

User ip validation, ip add by email script php mongodb

Okay… the title of this blogpost is a bit off….

I really don’t know how to call my new script.

It’s a IP validator, IP add, Email with timed validation link PHP MongoDBnscript.

Does that makes sense?

No? Let me explainn< !–more –>nSo you got a page or site or script or backend you only want access to for anfew people.

It could be your family or you clients or the neighbours, but you don’t wantnto hand out usernames and passwords for them to log in.

What do you do? Yes you give them access on their IP address. But… IPnaddresses change! They change a lot! You don’t want to change the code everyntime someones ip address changes.

So you create a IP add page with a never to guess name, like:

and when your family member visits the page it automatically add the visitorsnIP, that so cool and handy!

No, it’s NOT!

I would never guess this url! But, here’s google chrome! You go to this pagen…. and guess what Chrome does? Yes… it sends all kind of information to it’snservers.

It sends this : “hey Creator look what I found! A page You have never visitednof indexed before! But Now you CAN!”

Bye Bye to your once oh so safe (NOT!!!) ip address add page!

So I created a better ip address add page and everybody in the world can knownabout it!
nBecause it doesn’t do anything except, if you are not allowed to visit thenpage, show a one field form.

With this form the visitor of you page can fill in his (or her) email address.nI see you thinking…. but when everybody can fill in an email address, wouldn’tneverybody get access?

No! Because I build in more failsafes.

First, the domain or email address has to be know by the system. You can addnmultiple domains and email addresses that are accepted by the system.
nSecond, the system will mail a special hashed link to that email address thatnis only valid for a certain period of time (you can set this in the config).nThe user has to open his mail and press the link before it’s invalid on the ipnaddress he (or she) visited your site.

Now the IP address is validated to the system and the user can access yournpage, or script or whatever.

But wait, there is more! After say 30 days (you can change that in the config)nthe IP address will be erased from the system! Why? Well, maybe the IP addressnchanges for that user and it will just fill up your system with IP addressesnthat you don’t want anymore. So after 30 days (of what ever you want) thenvisitor has to re-validate his or her IP address again.

But! There is more! You might not want to be re-validating your own IP addressnover and over again, so you can put in a few addresses in the config that arenallowed all the time!

And yes…. there is even more! The system is build on blazing fast MongoDB! Andnit’s free to use!

You can find my new Script on BitBucket.

** I do like coffee! So if you like, please donate a penny or so.**

** You can find my donate buttons on the top right!**

Annoying noise HP envy 7640 solution!!!

Beep…. Beep … Beep a constant beeping noise in my ear when I turn on the HPnenvy 7640.

Beep…. Beep … Beep a constant beeping noise in my ear when I turn on the HPnenvy 7640.n< !–more –>nI was about to pull out my hair… or throw the HP 7640 out of my window.

It drove me crazy!!!

And then I found te sollution!

So I tried to record the sound or beeping or peeping noise the HP envy 7640nmakes.

Here’s the sound mine made ( turn your volume up!! )

When I turned the HP off… the sound was a bit better…. but I could still hearnit!

The HP is a great printer. I do a lot of printing and scanning on it! Evennwith my iPhone when I’m around the house.

The colors are very vivid and the printing and scanning doesn’t take a lot ofntime. And even better… the whole street uses my Printer to print their stuff.nNeighbours just send their files by mail to my printer. The then give me ancall if they can get the printed stuff 🙂

But it’s the sound!!! The ever lasting Beeeeeeeep or Peeeeeeeeep… well you getnthe picture… I mean you get the Hearing when you play the above file. I wasnabout to sell the damn noise making printer and then I found the solution!!!

The solution is simple! Just unplug it! Yes yes…. Unplug it from the wallnoutlet! And the MotherF@&$^!*& is finally quiet!!

Ha ha ha okay, that’s not a real solution, but for now it works!

The real solution is to Call HP! Yes call them!!

For the Netherlands:
n020–721 90 41 van ma-vr tussen 08.30–18.00

For other countries look on the HP site. I would have searched for it for you,nbut it keeps redirecting me to the Dutch site.

When you call them explain the problem. That the noise is gone when you unplugnthe mother! What they will do is send you a new adapter. It an internal onenbut replacing the adapter on the HP envy 7640 is very simple! My 4 year oldnson could do it! (yes I actually saw him do it!)

After replacing it, the noise is gone! Sit back and relax and enjoy your HPnPrinter again!

Url shortener with PHP and MongoDB script

n Last week at work some marketing guys asked me if I could build a URL Shortener script.n

They did not want to use bitly anymore.

I told them that I had a url shortener sites ones (snurl.eu) and that I could probably could find the script again.

When I found the script and thought about MongoDB… I guess it was time to rewrite it.

nn (meer…)

Installation and configuration S3CMD Centos

At work and home (for my nopnop.nl site) I needed a waynto backup a server (mysql / mongodb and files). I could just zip it and ftp itnto my Synology at home… but…. why not save the cloud server files on anotherncloud like AWS Amazon!

So I found the S3CMD tools for connecting to mynAWS Bucket.n< !–more –>nInstallation was not very easy. Which means that “yum install s3cmd” on CENTOSnjust did not work. So I searched the internet for the solution and created ancomplete installation with python 2.7 and configuration.

S3CMD Installation

This will mostly likely work on any older distro where s3cmd is stuck atn1.0.x. What you need is the multipart upload support that is in version 1.1.xnand greater. The strategy for CentOS 5.x is that you don’t want to break thenPython 2.4 base install as admin features within CentOS 5.x rely on it.nTherefore, we want to create a self contained Python 2.7 installation.

1. Remove s3cmd package

1n
yum remove s3cmdn

2. Install at least Python 2.7.

IMPORTANT: MAKE SURE TO USE “make altinstall” in the last step

1n2n3n4n5n6n7n8n9n10n11n12n13n14n15n16n17n18n19n20n21n22n23n24n25n26n27n28n29n30n31n32n33n34n35n36n37n38n39n40n41n42n43n44n45n46n47n48n49n50n51n52n53n54n55n56n57n58n59n60n61n62n63n64n65n66n67n68n69n70n71n72n73n74n75n76n77n78n79n80n81n82n83n84n85n86n87n88n89n90n91n92n93n94n95n96n97n98n99n100n101n102n103n104n105n106n107n108n109n110n111n112n113n114n115n116n117n118n119n120n121n122n123n124n125n
wget nnntar xf Python-2.7.3.tar.bz2nnncd Python-2.7.3 ./configure --prefix=/usr/localnnnmake && make altinstallnnn3. Download and compile latest s3cmd against Python 2.7nnnwget -O v1.5.0-alpha3.tar.gz nnntar xvzf v1.5.0-alpha3.tar.gznnncd s3cmd-1.5.0-alpha3/nnnpython2.7 setup.py installnnn4. Reload shell and testnnnexec bashnnns3cmd --versionnnn **Outcome** :nnns3cmd version 1.5.0-alpha3nnn5. Configure s3cmdnnnIn order to configure s3cmd we would required Access Key and Secret Key of your S3 Amazon account. Get these security keys from aws securityCredentials page. If will prompt to login to your amazon account.nnnAfter getting key files, use below command to configure s3cmd.nnns3cmd --configurennnWill result in:nnnFill in the Credentials as known for your server on Amazon.nnnKey Id: [KEY ID]nnnSecret Access Key: [SECRET ACCESS KEY]nnnPassword: [PASSWORD]nnnPath to GPG program [/usr/bin/gpg]: [ENTER]nnnUse HTTPS protocol [No]: No (no encryption needed as files are already encrypted)nnnHTTP Proxy server name: [ENTER]nnnTest access with supplied credentials? [Y/n] Ynnn **Outcome:**nnnPlease wait, attempting to list all buckets...nnnPlease wait...nnnSuccess. Your access key and secret key worked fine :-)nnnNow verifying that encryption works...nnnSuccess. Encryption and decryption worked fine :-)nnn **Or !!  n Outcome:**nnnPlease wait, attempting to list all buckets...nnnWARNING: Retrying failed request: /?delimiter=/ ([Errno 32] Broken pipe)nnnWARNING: Waiting 3 sec...nnnSuccess. Your access key and secret key worked fine :-)nnnNow verifying that encryption works...nnnSuccess. Encryption and decryption worked fine :-)  nSave settings? [y/N] YnnnAll done!  nNow you can connect easily to your own amazon bucket!  nWith special thanks to these sites : [minimul.com](http://minimul.com/install-the-latest-s3cmd-on-centos-5.html) and [tecadmin.net](http://tecadmin.net/install-s3cmd-manage-amazon-s3-buckets/)n

Ghost.org to Blogger import php script

Ghost is a platform dedicated to one thing: Publishing. It’s beautifully designed, completely customisable and completely Open Source. Ghost allows you to write and publish your own blog, giving you the tools to make it easy and even fun to do.

The Ghost application is free. Free to use, free to modify, free to share, free to redistribute. You can do anything you like with the software, without legal restriction.

But I don’t want to modify it… I don’t want to redistribute it.. I just want to use it … without any installation or upgrading or anything… I just want to blog.

And than…. Ghost is not free!

nn (meer…)