Git /usr/local/lib/liblber & /usr/local/lib/libldap_r no version information available error
I just updated my system today and rebooted (I like to reboot once a couple weeks…) and git started freeking out on me.
I tried to git add ap [tab tab] but “git: /usr/local/lib/liblber-2.4.so.2: no version information available (required by /usr/lib/libcurl-gnutls.so.4)” would pop up before the auto-complete and mess everything up. I could continue without autocomplete but thats not a console I want to be in. I need my terminal to give me auto complete!
I fixed it by
Read the rest of this post »
In: Server Config, Ubuntu Tricks · Tagged with: git
MySQL Admin via SSH Tunnel
Lets create a ssh tunnel into our remote server so that we can connect MySQL Administrator. This will trick MySQL Administrator into thinking that it has a local connection to the remote machine when it doesn’t. This is great for getting around having only local MySQL access rights while trying to login from a remote machine.
Now boot up MySQL Administrator and connect to localhost or 127.0.0.1 port 3305. Bam, your into your remote mysql server.
You may notice some werid things like “Server not running”, ignore it. Basically it means that it has connected to the MySQL server but can’t find the program running locally. Also the MySQL Administrator interface will hang a bit when fetching data. Silly one threaded programmers. Always disconnect your UI from the data via threads!
In: Server Config, Ubuntu Tricks, Web Development · Tagged with: MySQL Administrator, ssh
SEO for large Dynamic sites
Over the last year I have worked very close at improving the SEO for a large dynamic website. The website has 200k+ pages, 99% of which are user content. The website currently relies solely on Google traffic and has no large inbound links.
Here is some of the things that I have learnt first hand that have improved our traffic.
Step One – Start measuring it.
Without measuring something you are trying to improve, you will never improve it. Period. Read the rest of this post »
In: SEO, Web Development · Tagged with: 404, dynamic content, featured, google analytics, google webmaster tools, search engine optimization, search traffic, SEO, title tags
Can’t Access Github behind proxy or Firewall
Use corkscrew to get through the firewall. You will have to install it from source.
website: http://www.agroman.net/corkscrew/
Now edit your ~/.ssh/config file, create it if you haven’t got one.
Host gitproxy
User git
Hostname ssh.github.com
Port 443
ProxyCommand /usr/local/bin/corkscrew proxy.example.com 3128 %h %p
IdentityFile /home/jordan/.ssh/id_rsa
Now use this proxy when cloning git Read the rest of this post »
In: Server Config, Ubuntu Tricks, Web Development · Tagged with: corkscrew, git, github.com, http proxy, ssh
PostGIS psqlostgis ERROR could not load library /usr/lib/postgresql/8.4/lib/postgis-1.5.so
Trying to install PostGIS and you can’t get past this error?
DETAIL: Creating a shell type definition.
psqlostgis.sql:57: ERROR: could not load library “/usr/lib/postgresql/8.4/lib/postgis-1.5.so”: /usr/lib/postgresql/8.4/lib/postgis-1.5.so: undefined symbol: GEOSHausdorffDistance
psqlostgis.sql:63: ERROR: current transaction is aborted, commands ignored until end of transaction block
psqlostgis.sql:68: ERROR: current transaction is aborted, commands ignored until end of transaction block
A simple solution to your problem is the following voodoo command Read the rest of this post »
In: Ruby on Rails, Server Config · Tagged with: error, ldconfig, PostGIS, postgresql, problem
Open remote application window over ssh – X11
You left the office but forgot to leave an application running. An application that requires it’s GUI, you try to open it via ssh but “Error: Can’t open display” prevents you.
Simple fix here, you will kick yourself.
for me this translated into
What this does is instruct the application to open in display 0, which is the remote machine.
In: Ubuntu Tricks · Tagged with: remote, ssh, sshd, x11
Fetch Email Attachments with Ruby on Rails
This snippet is used in one of my projects to automatically import a csv into the database. It uses cron to check an email account via IMAP. When a unread email is found it will try to match it to subject lines in the database. If there is an entry it will attempt to import the attachment in the email. Once done it will email me the results.
I have deleted lines of code which relate to my specific needs to just give you the overview.
Uses Net::IMAP and TMail.
class MailImporter
def self.check_for_emails
completed ||= {}
imap = Net::IMAP.new(‘imap.gmail.com’,993,true)
imap.login(“[email protected]”, “mygmailpassword”)
imap.select(‘INBOX’) #which folder
imap.search([“NOT”,”SEEN”]).each do |message_id| #only get messages which are not read
if MailImporter.receive(imap.fetch(message_id, “RFC822”)[0].attr[“RFC822”])
imap.store(message_id, “+FLAGS”, [:Seen]) #mark read
end
imap.logout()
imap.disconnect()
completed.each do |data_email, leads|
DataEmailMailer.deliver_imported #email me
end
end
def self.receive(email)
mail = TMail::Mail.parse(email)
data_email = DataEmail.find_by_subject mail.subject #store subject lines in database, only import those which match, could link subject lines to another model if the import has any belongs_to or has_manys
if data_email
MailImporter.import_attachment(data_email, mail.attachments.first) unless mail.attachments.empty?
else
false
end
end
def self.import_attachment(data_email, attachment)
csv = attachment.read
FasterCSV.parse(csv) do |row|
#parse the row somehow and add it to your DB
end
true #return true if it all went well, could use a condition here and relate it to the import
end
end
In: Ruby on Rails · Tagged with: attachment, automation, cron, email, import, TMail
Factory Farming Possibility in NZ
Get the full story and how to oppose the factory farming
In: Uncategorized