<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>Alt om ingenting og litt i mellom &#187; tips</title>
	<atom:link href="http://hovenko.no/blog/tag/tips/feed/" rel="self" type="application/rss+xml" />
	<link>https://hovenko.no/blog</link>
	<description>En blogg av Knut-Olav</description>
	<lastBuildDate>Mon, 10 Mar 2025 19:25:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>FreeBSD top of network connections</title>
		<link>https://hovenko.no/blog/2012/10/02/freebsd-top-of-network-connections/</link>
		<comments>https://hovenko.no/blog/2012/10/02/freebsd-top-of-network-connections/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 22:31:43 +0000</pubDate>
		<dc:creator>Knut-Olav</dc:creator>
				<category><![CDATA[English-posts]]></category>
		<category><![CDATA[Teknologi]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://hovenko.no/blog/?p=784</guid>
		<description><![CDATA[To view the active connections in FreeBSD, which might be a very good debugging/overview tool for a router, one can use ipfstat -t. This will output something like this: Source IP Destination IP ST PR #pkts #bytes ttl 10.1.1.100,1052 199.47.216.148,80 4/4 tcp 37860 6446150 119:59:07 10.1.1.100,17500 255.255.255.255,17500 0/0 udp 11681 1740469 1:55 10.1.1.100,17500 10.1.1.255,17500 0/0 [...]]]></description>
			<content:encoded><![CDATA[<p>To view the active connections in FreeBSD, which might be a very good debugging/overview tool for a router, one can use <strong>ipfstat -t</strong>.</p>
<p>This will output something like this:</p>
<p><code>
<pre>
Source IP             Destination IP         ST   PR   #pkts    #bytes       ttl
10.1.1.100,1052       199.47.216.148,80     4/4  tcp   37860   6446150 119:59:07
10.1.1.100,17500      255.255.255.255,17500 0/0  udp   11681   1740469      1:55
10.1.1.100,17500      10.1.1.255,17500      0/0  udp   11681   1740469      1:55
</pre>
<p></code></p>
]]></content:encoded>
			<wfw:commentRss>https://hovenko.no/blog/2012/10/02/freebsd-top-of-network-connections/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding which Windows process uses what IP socket</title>
		<link>https://hovenko.no/blog/2012/10/02/finding-which-windows-process-uses-what-ip-socket/</link>
		<comments>https://hovenko.no/blog/2012/10/02/finding-which-windows-process-uses-what-ip-socket/#comments</comments>
		<pubDate>Mon, 01 Oct 2012 22:22:55 +0000</pubDate>
		<dc:creator>Knut-Olav</dc:creator>
				<category><![CDATA[English-posts]]></category>
		<category><![CDATA[Teknologi]]></category>
		<category><![CDATA[netstat]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://hovenko.no/blog/?p=781</guid>
		<description><![CDATA[To find out which application uses what IP port on a Windows, both open listening sockets and open connections, you can use netstat with some options and then grep for the port number, or findstr as it&#8217;s called in Windows world. netstat -ano &#124; findstr &#8220;:xxxx&#8221; This outputs something like this: Aktive tilkoblinger Prot. Lokal [...]]]></description>
			<content:encoded><![CDATA[<p>To find out which application uses what IP port on a Windows, both open listening sockets and open connections, you can use netstat with some options and then grep for the port number, or findstr as it&#8217;s called in Windows world.</p>
<p><strong>netstat -ano | findstr &#8220;:xxxx&#8221;</strong></p>
<p>This outputs something like this:<br />
<code>
<pre>
Aktive tilkoblinger

  Prot. Lokal adresse          Ekstern adresse          Tilstand           PID
  TCP    0.0.0.0:135            0.0.0.0:0              LISTENING       1232
  TCP    0.0.0.0:445            0.0.0.0:0              LISTENING       4
  TCP    0.0.0.0:17500          0.0.0.0:0              LISTENING       3500
  TCP    10.1.1.100:139         0.0.0.0:0              LISTENING       4
  TCP    10.1.1.100:1051        10.1.1.1:443           CLOSE_WAIT      3500
  TCP    10.1.1.189:1052        199.47.216.148:80      ESTABLISHED     3500
</pre>
<p></code></p>
<p>In the right column you&#8217;ll find the PID of the process using the socket. Open task manager, make sure the PID column is visible (might need to add it to the view, then look around in the drop down menus).</p>
<div id="attachment_792" class="wp-caption alignnone"><img src="http://hovenko.no/blog/wp-content/uploads/2012/10/taskmanager-pid1.png" alt="Windows Task Manager shows process PID of Dropbox" title="Windows Task Manager shows process PIDs" width="439" height="40" class="size-full wp-image-792" /><p class="wp-caption-text">Windows Task Manager shows process PID of Dropbox</p></div>
<p>Source: <a href="http://www.windowsnetworking.com/kbase/WindowsTips/WindowsServer2008/AdminTips/Network/DeterminingwhatserviceorapplicationownsaTCPport.html" title="Determining what service or application owns a TCP port">http://www.windowsnetworking.com/kbase/WindowsTips/WindowsServer2008/AdminTips/Network/DeterminingwhatserviceorapplicationownsaTCPport.html</a></p>
]]></content:encoded>
			<wfw:commentRss>https://hovenko.no/blog/2012/10/02/finding-which-windows-process-uses-what-ip-socket/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>whiptail &#8211; enkel dialogboks for terminalen</title>
		<link>https://hovenko.no/blog/2010/06/07/whiptail-enkel-dialogboks-for-terminalen/</link>
		<comments>https://hovenko.no/blog/2010/06/07/whiptail-enkel-dialogboks-for-terminalen/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 20:46:02 +0000</pubDate>
		<dc:creator>Knut-Olav</dc:creator>
				<category><![CDATA[Teknologi]]></category>
		<category><![CDATA[dialogboks]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[whiptail]]></category>

		<guid isPermaLink="false">http://hovenko.no/blog/?p=381</guid>
		<description><![CDATA[Dette er først og fremst en huskelapp for min egen del, men kanskje nyttig for andre også. Jeg har laget mange shellscripts for å hjelpe meg i systemutvikling og til vedlikehold av tjenester. Av og til har jeg behov for å bekrefte at jeg virkelig ønsker å utføre handlingen, i tilfelle man skulle kjøre kommandoen [...]]]></description>
			<content:encoded><![CDATA[<p>Dette er først og fremst en huskelapp for min egen del, men kanskje nyttig for andre også.</p>
<p>Jeg har laget mange shellscripts for å hjelpe meg i systemutvikling og til vedlikehold av tjenester. Av og til har jeg behov for å bekrefte at jeg virkelig ønsker å utføre handlingen, i tilfelle man skulle kjøre kommandoen ved et uhell, for eksempel å tømme Solr-indeksen (Solr er en søkemotor, et prosjekt fra Apache).</p>
<p>Ofte holder det med å bruke &#8220;read&#8221; for å lese inn tekst til en variabel, men et verktøy som heter &#8220;whiptail&#8221; gir et ncurses-grensenitt som tilbyr brukeren til å utføre forskjellige valg, for eksempel valget om &#8220;ja&#8221; eller &#8220;nei&#8221; for å utføre en kommando.</p>
<p>Som det aller enkleste eksempelet har man &#8220;yesno&#8221;-dialogboksen:</p>
<div class="shell-code">
<pre class="hl"><code>
 # Ja/Nei-dialogboks med 10 rader og 50 kolonner
 # Skriver "jada" på skjermen hvis man velger "ja"
 whiptail --yesno "Vil du virkelig gå videre?" \
   10 50 &#038;&#038; echo "jada"
</code></pre>
</div>
<p>Man kontrollerer svaret fra dialogboksen med exit-koden fra whiptail. Svarer man så &#8220;ja&#8221; i dialogboksen skrives &#8220;jada&#8221; ut på skjermen. Svarer man nei, så gjør den det ikke. Så enkelt.</p>
<p>Et annet eksempel er å vise en liste med som brukeren kan velge blant:</p>
<div class="shell-code">
<pre class="hl"><code>
 whiptail --menu "Velg noe" \
   10 50 2 \
   1 "Valg 1" \
   2 "Valg 2" \
   3 "Valg 3" \
   4 "Valg 4"
</code></pre>
</div>
<p>Argumentet &#8220;2&#8243; angir hvor mange valg som skal vises ad gangen, etterfulgt av ID/tekst-par for valgene. ID-en til valget som brukeren velger blir skrevet på skjerm.</p>
<p>Man har også andre former for dialogbokser, se &#8220;man whiptail&#8221; for flere opsjoner.</p>
]]></content:encoded>
			<wfw:commentRss>https://hovenko.no/blog/2010/06/07/whiptail-enkel-dialogboks-for-terminalen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
