updating to postgresql 9.2.4
I needed to upgrade pg_dump from 9.1.9 to 9.2.4, so I needed to upgrade postgresql as well. I found the solution here.
1
2
3
4
wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install postgresql-common -t raring
sudo apt-get install postgresql-9.2
After doing this I symlinked the 9.2.4 pg_dump version:
convert between encodings from the command line
Here’s how to change a file’s encoding from windows-1250 to utf-8:
1
iconv -f windows-1250 -t utf-8 some_file.txt
Compiling threads under ubuntu
Command to compile: g++ r.cpp -o x -pthread -std=c++0x
1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <thread>
using namespace std;
void do_work() {
cout << "Doing work" << endl;
}
int main(int argc,char* argv[]) {
std::thread t(do_work);
t.join();
}
Compiling cpp code using a rakefile
Been trying to build smth with libcurl. These is my Rakefile:
1
2
3
4
5
6
7
8
9
10
PROG = "x"
files = FileList["**/*.cpp"]
linked_libs_folders = ["/home/john/code/cpp1/curl-7.32.0/installed/lib"].map {|e| "-L#{e}"}.join(" ")
libs_to_link_against = ["curl"].map {|e| "-l#{e}"}.join(" ")
file PROG => files do
puts "Compiling #{PROG}"
sh "g++ #{files} -o #{PROG} #{linked_libs_folders} #{libs_to_link_against}"
end
task :default => [PROG]
booting without full network configuration
So that I didn’t have to wait almost 2 min for my Ubuntu to book, I changed my /etc/network/interfaces file to this: