<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Just a tech stuff» Just a tech stuff – Karol Zielinski’s tech life – python, java blog, web development blog</title>
	
	<link>http://tech.karolzielinski.com</link>
	<description>... because from time to time I'm a web developer, too</description>
	<lastBuildDate>Wed, 07 Jul 2010 13:54:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/JustATechStuff" /><feedburner:info uri="justatechstuff" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Linux: remove unwanted services from the system start-up</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/W_2K5krwGr4/linux-remove-unwanted-services-from-the-system-start-up</link>
		<comments>http://tech.karolzielinski.com/linux-remove-unwanted-services-from-the-system-start-up#comments</comments>
		<pubDate>Wed, 07 Jul 2010 13:54:09 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=539</guid>
		<description><![CDATA[Default there are lots of services and programs which are starting to work while system start-up. It's time to disable these unwanted.
]]></description>
			<content:encoded><![CDATA[<p>Default there are lots of services and programs which are starting to work while system start-up. It&#8217;s time to disable these unwanted.</p>
<p><span id="more-539"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/07/linux.jpg"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/07/linux.jpg" alt="Linux / Unix" title="Linux / Unix" width="540" height="297" class="alignnone size-full wp-image-532" /></a></p>
<h2>List all services which are started at boot time</h2>
<pre>
chkconfig --list | grep '3:on'
</pre>
<p>and&#8230;</p>
<h2>Remove unwanted services</h2>
<pre>
service service_to_remove stop
</pre>
<p>and</p>
<pre>
chkconfig service_to_remove off
</pre>
<p><strong>That&#8217;s all.</strong></p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/linux-remove-unwanted-services-from-the-system-start-up" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/W_2K5krwGr4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/linux-remove-unwanted-services-from-the-system-start-up/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/linux-remove-unwanted-services-from-the-system-start-up</feedburner:origLink></item>
		<item>
		<title>Listening Network Ports</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/bNRfmr-JWJU/listening-network-ports</link>
		<comments>http://tech.karolzielinski.com/listening-network-ports#comments</comments>
		<pubDate>Thu, 01 Jul 2010 08:54:34 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[nmap]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=531</guid>
		<description><![CDATA[Two simple... but so useful commands for all kind of linux/unix servers administrators.]]></description>
			<content:encoded><![CDATA[<p>Two simple&#8230; but so useful commands for all kind of linux/unix servers administrators.</p>
<p><span id="more-531"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/07/linux.jpg"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/07/linux.jpg" alt="Linux / Unix" title="Linux / Unix" width="540" height="297" class="alignnone size-full wp-image-532" /></a></p>
<h2>Using netstat</h2>
<pre>
netstat -tulpn
</pre>
<h2>Using nmap</h2>
<pre>
nmap -sT -O localhost
</pre>
<p>or if you want to check someone&#8217;s open ports:</p>
<pre>
nmap -sT -O server.you.want.to.check.com
</pre>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/listening-network-ports" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/bNRfmr-JWJU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/listening-network-ports/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/listening-network-ports</feedburner:origLink></item>
		<item>
		<title>Update Ruby, Rails and gems</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/5WKoPk7TF1o/update-ruby-rails-and-gems</link>
		<comments>http://tech.karolzielinski.com/update-ruby-rails-and-gems#comments</comments>
		<pubDate>Wed, 16 Jun 2010 09:48:27 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[ruby / ruby on rails]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[rubygems]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=496</guid>
		<description><![CDATA[Few simply steps for updating Ruby, Rails and gems on your OS. I was doing it on Mac OS X, but it should works on UNIX-based systems as well.]]></description>
			<content:encoded><![CDATA[<p>Few simply steps for updating Ruby, Rails and gems on your OS. I was doing it on Mac OS X, but it should works on UNIX-based systems as well.</p>
<p><span id="more-496"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png" alt="Ruby on Rails" title="Ruby on Rails" width="87" height="111" class="alignnone size-full wp-image-479" /></a></p>
<h2>Install/update GEMS/RubyGems</h2>
<p>Download package from <a href="http://rubyforge.org/frs/?group_id=126">http://rubyforge.org/frs/?group_id=126</a> and unpack it.</p>
<p>Go inside new dir and run:</p>
<pre>
ruby setup.py
</pre>
<p>Now check Gems version on your system:</p>
<pre>
gem -v
</pre>
<h2>Install/update <a href="http://rubyonrails.org/">Rails</a></h2>
<pre>
gem update rails
</pre>
<p>and check do you have a new version of Rails:</p>
<pre>
rails -v
</pre>
<h2>Install/update <a href="http://www.ruby-lang.org/">Ruby</a></h2>
<pre>
sudo port install ruby
</pre>
<p>or</p>
<pre>
sudo apt-get install ruby
</pre>
<p>and check Ruby version:</p>
<pre>
ruby --version
</pre>
<p><strong>Note: sometimes you need to check new version of these tools in new window/new terminal.</strong></p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/update-ruby-rails-and-gems" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/5WKoPk7TF1o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/update-ruby-rails-and-gems/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/update-ruby-rails-and-gems</feedburner:origLink></item>
		<item>
		<title>Ruby on Rails: rake db:create → “Couldn’t create database for …</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/WvJjhVhDYrw/ruby-on-rails-rake-dbcreate-%e2%86%92-couldn%e2%80%99t-create-database-for</link>
		<comments>http://tech.karolzielinski.com/ruby-on-rails-rake-dbcreate-%e2%86%92-couldn%e2%80%99t-create-database-for#comments</comments>
		<pubDate>Mon, 14 Jun 2010 14:31:55 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[databases]]></category>
		<category><![CDATA[ruby / ruby on rails]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[ruby on rails]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=491</guid>
		<description><![CDATA[I try to set environment for my new Ruby on Rails + MySQL project. However when I am doing rake db:create I can see: "Couldn’t create database for ..."]]></description>
			<content:encoded><![CDATA[<p>I try to set environment for my new Ruby on Rails + MySQL project. However when I am doing rake db:create I can see: &#8220;Couldn’t create database for &#8230;&#8221;</p>
<p><span id="more-491"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png" alt="Ruby on Rails" title="Ruby on Rails" width="87" height="111" class="alignnone size-full wp-image-479" /></a></p>
<p>What I see is:</p>
<blockquote><p>
Couldn&#8217;t create database for {&#8220;encoding&#8221;=>&#8221;utf8&#8243;, &#8220;username&#8221;=>&#8221;my_username&#8221;, &#8220;adapter&#8221;=>&#8221;mysql&#8221;, &#8220;database&#8221;=>&#8221;my_database&#8221;, &#8220;pool&#8221;=>5, &#8220;password&#8221;=>&#8221;my_password&#8221;, &#8220;socket&#8221;=>&#8221;/tmp/mysql.sock&#8221;}, charset: utf8, collation: utf8_unicode_ci (if you set the charset manually, make sure you have a matching collation)
</p></blockquote>
<p>What I need to do?</p>
<p><strong>Change &#8220;socket: /tmp/mysql.sock&#8221; to &#8220;host: localhost&#8221; in <em>config/database.yml</em></strong></p>
<p>So my <em>config/database.yml</em> looks like:</p>
<pre name="code" class="ruby">
development:
  adapter: mysql
  encoding: utf8
  database: my_database
  pool: 5
  username: my_username
  password: my_password
  host: localhost

(...)
</pre>
<p>That&#8217;s all. Everything works fine.</p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/ruby-on-rails-rake-dbcreate-%e2%86%92-couldn%e2%80%99t-create-database-for" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/WvJjhVhDYrw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/ruby-on-rails-rake-dbcreate-%e2%86%92-couldn%e2%80%99t-create-database-for/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/ruby-on-rails-rake-dbcreate-%e2%86%92-couldn%e2%80%99t-create-database-for</feedburner:origLink></item>
		<item>
		<title>Apt-get package management in ubuntu</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/NdoydbfDhRY/apt-get-package-management-in-ubuntu</link>
		<comments>http://tech.karolzielinski.com/apt-get-package-management-in-ubuntu#comments</comments>
		<pubDate>Wed, 09 Jun 2010 08:55:35 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[apt-get]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=486</guid>
		<description><![CDATA[Everyone (each ubuntu user) knows how to install new package, search a package or remove one. However not everyone knows how to do something else.]]></description>
			<content:encoded><![CDATA[<p>Everyone (each ubuntu user) knows how to install new package, search a package or remove one. However not everyone knows how to do something else.</p>
<p><span id="more-486"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/01/UbuntuLogo.jpg"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/01/UbuntuLogo.jpg" alt="ubuntu" title="ubuntu" width="530" height="138" class="alignnone size-full wp-image-393" /></a></p>
<h2>Search packages</h2>
<pre>
apt-cache search package-to-search
</pre>
<h2>Install package</h2>
<pre>
sudo apt-get install package-to-install
</pre>
<h2>Remove package</h2>
<p>if you want to keep the configuration files:</p>
<pre>
sudo apt-get remove package-to-remove
</pre>
<p>or if you want to remove everything (package and config files):</p>
<pre>
sudo apt-get --purge remove package-to-remove
</pre>
<h2>Update package lists</h2>
<pre>
sudo apt-get update
</pre>
<h2>Update/upgrade package</h2>
<pre>
sudo apt-get install package-to-update
</pre>
<p>or</p>
<pre>
apt-get upgrade
</pre>
<h2>List all installed packages</h2>
<pre>
dpkg --list
</pre>
<h2>List individual package</h2>
<p>exactly this package:</p>
<pre>
dpkg -l package-to-list
</pre>
<p>list of related packages:</p>
<pre>
dpkg -l *package-to-list*
</pre>
<h2>What package owns the file?</h2>
<pre>
dpkg -S /usr/bin/python
</pre>
<h2>List dependencies of a package</h2>
<pre>
apt-cache depends our-package
</pre>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/apt-get-package-management-in-ubuntu" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/NdoydbfDhRY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/apt-get-package-management-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/apt-get-package-management-in-ubuntu</feedburner:origLink></item>
		<item>
		<title>Ruby on Rails: ‘require_frameworks’: no such file to load — net/https (RuntimeError)</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/skKtm8mHEb0/ruby-on-rails-require_frameworks-no-such-file-to-load-nethttps-runtimeerror</link>
		<comments>http://tech.karolzielinski.com/ruby-on-rails-require_frameworks-no-such-file-to-load-nethttps-runtimeerror#comments</comments>
		<pubDate>Fri, 28 May 2010 12:35:52 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[ruby / ruby on rails]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=478</guid>
		<description><![CDATA[I started to learn Ruby on Rails. First impression (based on screencasts and presentations) was very good. Next... I wanted to try it by myself. ]]></description>
			<content:encoded><![CDATA[<p>I started to learn <a href="http://rubyonrails.org/">Ruby on Rails</a>. First impression (based on <a href="http://rubyonrails.org/screencasts">screencasts and presentations</a>) was very good. Next&#8230; I wanted to try it by myself. And first trouble&#8230; <em>&#8220;initializer.rb:271:in `require_frameworks&#8217;: no such file to load &#8212; net/https (RuntimeError)&#8221;</em></p>
<p><span id="more-478"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png"><img class="alignnone size-full wp-image-479" title="Ruby on Rails" src="http://tech.karolzielinski.com/wp-content/uploads/2010/05/rails.png" alt="Ruby on Rails" width="87" height="111" /></a></p>
<p>However since the beginning&#8230;</p>
<h2>Install Ruby</h2>
<pre>sudo apt-get install ruby
</pre>
<h2>Install RubyGems</h2>
<pre>sudo apt-get install rubygems
</pre>
<h2>Install Rails</h2>
<pre>gem install rails
</pre>
<h2>Make an application</h2>
<pre>rails myappname
cd myappname
ruby script/server
</pre>
<p>And&#8230; first error. What can I see on console?</p>
<pre>=&gt; Booting WEBrick
=&gt; Rails 2.3.8 application starting on http://0.0.0.0:3000
/home/user/.gem/ruby/1.8/gems/rails-2.3.8/lib/initializer.rb:271:in `require_frameworks': no such file to load -- net/https (RuntimeError)
(...)
</pre>
<p>What is wrong?<br />
<strong> I don&#8217;t have the Ruby SSL support installed.</strong></p>
<p>What can I do?</p>
<pre>sudo apt-get install libopenssl-ruby1.8
</pre>
<p>and that&#8217;s all. Everything works fine right now.</p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/ruby-on-rails-require_frameworks-no-such-file-to-load-nethttps-runtimeerror" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/skKtm8mHEb0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/ruby-on-rails-require_frameworks-no-such-file-to-load-nethttps-runtimeerror/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/ruby-on-rails-require_frameworks-no-such-file-to-load-nethttps-runtimeerror</feedburner:origLink></item>
		<item>
		<title>Controlling Buffer Overflow Attacks by limiting settings in nginx</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/acTv9phePFI/controlling-buffer-overflow-attacks-by-limiting-settings-in-nginx</link>
		<comments>http://tech.karolzielinski.com/controlling-buffer-overflow-attacks-by-limiting-settings-in-nginx#comments</comments>
		<pubDate>Wed, 26 May 2010 10:29:34 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[administration]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[overload]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=473</guid>
		<description><![CDATA[You have to limit few things in your nginx.conf: buffer size, body size and timeouts.]]></description>
			<content:encoded><![CDATA[<p>You have to limit few things in your nginx.conf: buffer size, body size and timeouts.</p>
<p><span id="more-473"></span></p>
<p>Open you nginx.conf (<em>/usr/local/nginx/conf/nginx.conf</em>) and edit/add few settings:</p>
<pre name="code" class="python">
# buffer size, body size
client_body_buffer_size  1K;
client_header_buffer_size 1k;
client_max_body_size 1k;
large_client_header_buffers 2 1k;

# timeouts
client_body_timeout   10;
client_header_timeout 10;
keepalive_timeout     5 5;
send_timeout          10;
</pre>
<p>These values are too low in my opinion. However they come from <a href="http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html">this website</a>, so they are worth to consider.</p>
<p>Now (descriptions come from <a href="http://www.cyberciti.biz/tips/linux-unix-bsd-nginx-webserver-security.html">cyberciti.biz</a>):</p>
<ul>
<li><strong>client_body_buffer_size</strong> &#8211; (default is 8k or 16k) The directive specifies the client request body buffer size.</li>
<li><strong>client_header_buffer_size</strong> &#8211; Directive sets the headerbuffer size for the request header from client. For the overwhelming majority of requests a buffer size of 1K is sufficient. Increase this if you have a custom header or a large cookie sent from the client (e.g., wap client).</li>
<li><strong>client_max_body_size</strong> &#8211; Directive assigns the maximum accepted body size of client request, indicated by the line Content-Length in the header of request. If size is greater the given one, then the client gets the error &#8220;Request Entity Too Large&#8221; (413). Increase this when you are getting file uploads via the POST method.</li>
<li><strong>large_client_header_buffers</strong> &#8211; Directive assigns the maximum number and size of buffers for large headers to read from client request. By default the size of one buffer is equal to the size of page, depending on platform this either 4K or 8K, if at the end of working request connection converts to state keep-alive, then these buffers are freed. 2x1k will accept 2kB data URI. This will also help combat bad bots and DoS attacks.</li>
<li><strong>client_body_timeout</strong> &#8211; Directive sets the read timeout for the request body from client. The timeout is set only if a body is not get in one readstep. If after this time the client send nothing, nginx returns error &#8220;Request time out&#8221; (408). The default is 60.</li>
<li><strong>client_header_timeout</strong> &#8211; Directive assigns timeout with reading of the title of the request of client. The timeout is set only if a header is not get in one readstep. If after this time the client send nothing, nginx returns error &#8220;Request time out&#8221; (408).</li>
<li><strong>keepalive_timeout</strong> &#8211; The first parameter assigns the timeout for keep-alive connections with the client. The server will close connections after this time. The optional second parameter assigns the time value in the header Keep-Alive: timeout=time of the response. This header can convince some browsers to close the connection, so that the server does not have to. Without this parameter, nginx does not send a Keep-Alive header (though this is not what makes a connection &#8220;keep-alive&#8221;).</li>
<li><strong>send_timeout</strong> &#8211; Directive assigns response timeout to client. Timeout is established not on entire transfer of answer, but only between two operations of reading, if after this time client will take nothing, then nginx is shutting down the connection.</li>
</ul>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/controlling-buffer-overflow-attacks-by-limiting-settings-in-nginx" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/acTv9phePFI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/controlling-buffer-overflow-attacks-by-limiting-settings-in-nginx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/controlling-buffer-overflow-attacks-by-limiting-settings-in-nginx</feedburner:origLink></item>
		<item>
		<title>Linux server &amp; security: SELinux</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/tAKo1BeafXQ/linux-server-security-selinux</link>
		<comments>http://tech.karolzielinski.com/linux-server-security-selinux#comments</comments>
		<pubDate>Fri, 21 May 2010 09:47:39 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[selinux]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=468</guid>
		<description><![CDATA[How to secure your server against burglary? By installing and turning on the right software. SELinux is one of these software.]]></description>
			<content:encoded><![CDATA[<p>How to secure your server against burglary? By installing and turning on the right software. SELinux is one of these software.</p>
<p><span id="more-468"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/05/security.jpg"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/05/security-300x230.jpg" alt="" title="security" width="300" height="230" class="alignnone size-medium wp-image-470" /></a></p>
<p>That will be a quick tip&#8230;</p>
<p>First&#8230; <a href="http://tech.karolzielinski.com/build-firewall-on-server-ubuntu">build firewall on your server</a>.</p>
<p>Then&#8230; install and turn on <a href="http://en.wikipedia.org/wiki/Security-Enhanced_Linux">SELinux</a>.</p>
<blockquote><p>
SELinux is a kernel security extension, which can be used to guard against misconfigured or compromised programs. It comes with Mandatory Access Control (MAC) system that improves the traditional UNIX/Linux DAC (Discretionary Access Control) model.
</p></blockquote>
<p>How to install it on Ubuntu?<br />
Using apt-get.</p>
<pre>sudo apt-get install selinux</pre>
<p>and reboot system.</p>
<p>Now you can <a href="http://www.cyberciti.biz/faq/rhel-fedora-redhat-selinux-protection/">configure and enable it</a>.</p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/linux-server-security-selinux" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/tAKo1BeafXQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/linux-server-security-selinux/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/linux-server-security-selinux</feedburner:origLink></item>
		<item>
		<title>“decoder jpeg not available” on Mac OS X</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/Ne4GKY7nDEQ/decoder-jpeg-not-available-on-mac-os-x</link>
		<comments>http://tech.karolzielinski.com/decoder-jpeg-not-available-on-mac-os-x#comments</comments>
		<pubDate>Mon, 15 Mar 2010 10:30:31 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[mac]]></category>
		<category><![CDATA[other]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[libjpeg]]></category>
		<category><![CDATA[mac os x]]></category>
		<category><![CDATA[pil]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=463</guid>
		<description><![CDATA[I have an error &#8220;decoder jpeg not available&#8221; while working on one of my python projects on Mac OS X. Why is that and how to fix it? First&#8230; download MacPorts and run the install it on your Mac. And then&#8230; sudo port install jpeg This will install libjpeg. And after that it&#8217;s time for [...]]]></description>
			<content:encoded><![CDATA[<p>I have an error <em>&#8220;decoder jpeg not available&#8221;</em> while working on one of my python projects on Mac OS X. Why is that and how to fix it?</p>
<p><span id="more-463"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/03/mac-os-x.png"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/03/mac-os-x-300x261.png" alt="Mac OS X" title="Mac OS X" width="300" height="261" class="alignnone size-medium wp-image-465" /></a></p>
<p>First&#8230; download <a href="http://www.macports.org/">MacPorts</a> and run the install it on your Mac.</p>
<p>And then&#8230;</p>
<pre>
sudo port install jpeg
</pre>
<p>This will install libjpeg.</p>
<p>And after that it&#8217;s time for PIL.</p>
<pre>
sudo /opt/local/bin/port install py25-pil
</pre>
<p>Probably you&#8217;ll need to supplement your PYTHONPATH with the location of the python libraries that MacPorts uses. In your /etc/profile or ~/.profile, add the following line:</p>
<pre>
export PYTHONPATH=/opt/local/lib/python2.5/site-packages
</pre>
<p>and that&#8217;s it. Now everything should be fine.</p>
<p>Helpful resources:</p>
<ul>
<li><a href="http://rezmuh.sixceedinc.com/2009/04/setting-up-pil-with-libjpeg-on-mac-os-x-leopard.html">http://rezmuh.sixceedinc.com/2009/04/setting-up-pil-with-libjpeg-on-mac-os-x-leopard.html</a></li>
<li><a href="http://emmby.blogspot.com/2008/05/installing-python-pil-on-mac-os-x-1052.html">http://emmby.blogspot.com/2008/05/installing-python-pil-on-mac-os-x-1052.html</a></li>
</ul>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/decoder-jpeg-not-available-on-mac-os-x" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/Ne4GKY7nDEQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/decoder-jpeg-not-available-on-mac-os-x/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/decoder-jpeg-not-available-on-mac-os-x</feedburner:origLink></item>
		<item>
		<title>Publish post on Facebook Page wall as a Page (not a user) (python + Facebook REST API)</title>
		<link>http://feedproxy.google.com/~r/JustATechStuff/~3/FI-b_U15sIM/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api</link>
		<comments>http://tech.karolzielinski.com/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api#comments</comments>
		<pubDate>Tue, 23 Feb 2010 12:32:39 +0000</pubDate>
		<dc:creator>Karol Zielinski</dc:creator>
				<category><![CDATA[python]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook api]]></category>
		<category><![CDATA[fan page]]></category>
		<category><![CDATA[rest]]></category>

		<guid isPermaLink="false">http://tech.karolzielinski.com/?p=449</guid>
		<description><![CDATA[After long days (or even weeks) of fighting with this issue&#8230; today I can be proud of myself. At last&#8230; I did it and it works! I can publish new posts on Facebook Page wall as a Page, not as a user (admin of that page). I found lots of discussions about that, however none [...]]]></description>
			<content:encoded><![CDATA[<p>After long days (or even weeks) of fighting with this issue&#8230; today I can be proud of myself. At last&#8230; I did it and it works! I can publish new posts on Facebook Page wall as a Page, not as a user (admin of that page). </p>
<p><span id="more-449"></span></p>
<p><a href="http://tech.karolzielinski.com/wp-content/uploads/2010/02/facebook.jpg"><img src="http://tech.karolzielinski.com/wp-content/uploads/2010/02/facebook-300x213.jpg" alt="Facebook" title="Facebook" width="300" height="213" class="alignnone size-medium wp-image-450" /></a></p>
<p>I found lots of discussions about that, however none of them were enough for me. Some of the discussions:</p>
<ul>
<li><a href="http://bugs.developers.facebook.com/show_bug.cgi?id=8184">http://bugs.developers.facebook.com/show_bug.cgi?id=8184</a></li>
<li><a href="http://bugs.developers.facebook.com/show_bug.cgi?id=8691">http://bugs.developers.facebook.com/show_bug.cgi?id=8691</a></li>
</ul>
<p>And now&#8230; my solution:</p>
<p>Log in to Facebook, create new app, create fan page.</p>
<p>Now you are ready.</p>
<h2>Add app to your fan page. </h2>
<p>Go to <a href="http://www.facebook.com/apps/application.php?id=ID_OF_YOUR_APP">http://www.facebook.com/apps/application.php?id=ID_OF_YOUR_APP</a>. </p>
<p>Find link <em>&#8216;Add to my Page&#8217;</em> on the left, click on it. Find your page on the list and click on <em>&#8216;Add to page&#8217;</em> next to this page.</p>
<h2>Set application type</h2>
<p>Go to <a href="http://www.facebook.com/developers/editapp.php?app_id=ID_OF_YOUR_APP">http://www.facebook.com/developers/editapp.php?app_id=ID_OF_YOUR_APP</a>. </p>
<p>Choose <em>&#8216;Web&#8217;</em> next to <em>&#8216;Application type&#8217;</em> and click on <em>&#8216;Save Changes&#8217;</em> button.</p>
<h2>Add permissions to your app</h2>
<p>Prepare special link:</p>
<p><a href="http://www.facebook.com/connect/prompt_permissions.php?api_key=YOUR_API_KEY&#038;v=1.0&#038;next=http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&#038;display=page&#038;ext_perm=publish_stream,offline_access&#038;enable_profile_selector=1&#038;profile_selector_ids=ID_OF_YOUR_PAGE">http://www.facebook.com/connect/prompt_permissions.php?api_key=YOUR_API_KEY&#038;v=1.0&#038;next=http://www.facebook.com/connect/login_success.html?xxRESULTTOKENxx&#038;display=page&#038;ext_perm=publish_stream,offline_access&#038;enable_profile_selector=1&#038;profile_selector_ids=ID_OF_YOUR_PAGE</a></p>
<p>replace <em>YOUR_API_KEY</em> for an API KEY of your application and <em>ID_OF_YOUR_PAGE</em> for an id of your page</p>
<p>Run this URL in your web browser. Click on <em>&#8216;Allow&#8217;</em>. </p>
<p>You should see a message: <em>&#8216;Success&#8217;</em>.</p>
<h2>Check everything</h2>
<p>Go to <a href="http://developers.facebook.com/tools.php?app_id=335851346097">http://developers.facebook.com/tools.php?app_id=335851346097</a> and check your permissions.</p>
<p>Choose your application, change <em>&#8216;Response Format&#8217;</em> to <em>JSON</em>, choose method <em>&#8216;users.hasAppPermission&#8217;</em>, fill <em>publish_stream</em> in <em>ext_perm</em> and id of your page in <em>uid</em>.</p>
<p>You should see result: <strong>1</strong>.</p>
<p>That means that everything is ok.</p>
<h2>Write a code</h2>
<p>Right now I will show how to create script in python (with <a href="http://code.google.com/p/pyfacebook/">PyFacebook</a>), but the code is really similar to that from other programming languages.</p>
<pre name="code" class="python">
def add_to_fb();
	import facebook
	fb = facebook.Facebook('YOUR_API_KEY', 'YOUR_SECRET_KEY')
	fb.auth.createToken()
	fb.login(popup=False)

	#print 'offline access...'
	#b.request_extended_permission('offline_access')
	#print 'publish stream...'
	#fb.request_extended_permission('publish_stream')

	print 'get session...'
	fb.auth.getSession()

	print 'add...'

	try:
		id_of_message = fb.stream.publish(message='my test message', uid=ID_OF_YOUR_PAGE)
	except Exception, e:
		error_code = None
		try:
			error_code = e.code
		except AttributeError:
			pass

		if error_code:
			print  "Facebook returned an error - sorry! %s %s" % (str(e.code), repr(e))
		else:
			print  "Facebook returned an error - sorry (no error code)! %s" % (repr(e))
	else:
		print id_of_message
</pre>
<p>And that&#8217;s all. Try to use it.</p>
<p>Sometimes it&#8217;s necessary to use <em>request_extended_permission()</em> (if we want to add privileges to our user), so you can uncomment these two lines.</p>
<p>Lots of hours&#8230; but at last &#8211; <strong>success</strong>.</p>
<script src="http://feeds.feedburner.com/~s/?i=http://tech.karolzielinski.com/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api" type="text/javascript" charset="utf-8"></script><img src="http://feeds.feedburner.com/~r/JustATechStuff/~4/FI-b_U15sIM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://tech.karolzielinski.com/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api/feed</wfw:commentRss>
		<slash:comments>26</slash:comments>
		<feedburner:origLink>http://tech.karolzielinski.com/publish-post-of-facebook-page-wall-as-a-page-not-a-user-python-facebook-rest-api</feedburner:origLink></item>
	</channel>
</rss>
