Usenet – hatet – spammen

Usenet – hatet – spammen

Då och då tittar man in på Usenet. Det är nästan dött. Så när som på ett fåtal märkliga, rasistiska trådar. Och tips på hur man kan undvika att åka dit, genom att använda anonymiseringstjänster. ”Bygga ett nytt internet ovanpå det gamla lagret” menar man.

Lyckligtvis är inga av de klienter som erbjuder ”internet på internet” särskilt användarvänliga (vilket den ena artikeln också beskriver enligt nedan). Så jag antar att det är det dom menar med att man inte kan åka dit när man skriver där – man är ju praktiskt taget ensam där.

"EU förstör internet" - Usenet Post
”EU Förstör internet”
Att äta glass i Texas

Att äta glass i Texas

Kvinnan som slickade på glassen och ställde tillbaks den i kylen (inte i Sverige) är inte ensam. Det verkar finnas fler som sysslar med det. Exempelvis provsmakar dryckerna och ställer tillbaka dom igen. Här skulle jag kunna säga ”var är vi på väg?”, men vi är inte på väg nånstans. Skillnaden är att den nya generationens idioter filmar sina bevis – de tidigare generationerna saknade bara kamera.

Av allt att döma, efter att ha forskat lite mer på diverse videoklipp så finns det indikation på att en ny ofräsch trend, bland youtubare, är på väg att födas: ”store freezer challenge”.

Source: Karim Jovian, Facebook

Aftonbladet.

Help! /boot is full!

Help! /boot is full!

That won’t be the first time. When /boot is full, and you can’t purge any kernel because of those damn dependencies. I’ve bookmarked a script found at github for a while ago, which explains a safe way of cleaning old kernels. However, it won’t help all the way, as some dependencies might break the cleanup. So I combined this solution with a forced removal with the help of dpkg since some of the dependencies are’nt necessary if we want to REMOVE the kernels anyway. And one huge problem is that people only decide to show one part of the solution. Not the fact that some dependencies can and almost certainly will break the removal in some step.

So this is how it went!

#!/bin/bash

ipv4="-o Acquire::ForceIPv4=true"

if [ "$1" = "4" ] ; then
	withip=$ipv4
	echo "Going IPv4 ($withip)"
fi

echo "Autoremove+Purge."
apt-get $withip -y -f autoremove --purge >/dev/null 2>&1

if [ "$?" != "0" ] ; then
	echo "Auto Removal Failed!"
fi

echo "Old dependency fix."
apt-get $withip -f -y install >/dev/null 2>&1

if [ "$?" != "0" ] ; then
	echo "That failed. So we'll try to make up to it during this process."
fi

echo "Now, going old kernel cleanup!"
kern=$(dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r`)
hadErrors=0

for k in $kern
do
	echo apt-get -y purge $k
	apt-get $withip -y purge $k >/dev/null 2>&1

	if [ "$?" != "0" ] ; then
		echo "Failed apt-purge... Using plan B (--force-all -P)..."
		dpkg --force-all -P $k >/dev/null 2>&1
		echo "Rerunning stuff (apt-get -f -y install) for dependencies..."
		apt-get $withip -f -y install >/dev/null 2>&1
		if [ "$?" != "0" ] ; then
			echo "Still failing..."
			hadErrors=1
		fi
	fi
done

if [ "$hadErrors" = "1" ] ; then
	echo "I had errors. I should rerun this process, to see if there are more kernels that were left out after cleanup..."
	/usr/local/tornevall/cleankernel
fi

apt-get $withip autoremove
apt-get $withip update
apt-get $withip upgrade
apt-get $withip dist-upgrade

grb=$(which update-grub)
if [ "" != "$grb" ] ; then
	update-grub
else
	echo "Can't upgrade grub since update-grub is missing..."
fi
Asterisk [v16] + Skype via PJSIP (pjsip.conf)

Asterisk [v16] + Skype via PJSIP (pjsip.conf)

I’ve been looking a while now, for a proper pjsip-configuration for Asterisk that works with Skype. I found almost nothing but a shitload of dead ends. Either there was 484 Address Incomplete messages, 404 Not found or 403 Forbidden messages and nothing was leading me right. It turned out, not very quickly though, that the 403 Forbidden message was a thing about credits on the account that just had to be refilled.

Besides of this, most of the documentations covers just SIP (sip.conf) and that’s it. So here we go, with a default quick configuration for Skype, with Asterisk. The configuration is based on endpoints, so there’s nothing advanced with it. Just very basic.

First of all. You need to get yourself a phone number. This could be done via Skype Manager (as of july 2019, you may want to go via https://manager.skype.com/my/dashboard – however, links tend to die very fast on internet so over a few years this will probably also mismatch). Try to find your way to the ”Skype Connect” section (as of july 2019, I clicked via the allocation links – but I think you have to think a bit of yourself too). Configure what you need here and make sure you have credits added to the ”Outgoing calls” section!! Like the part below.

Next part is about configuring channels. So click on the channel-part and then jump the ”Authentication settings”. At this page, you will need to put the username and password into your pjsip.conf, with the sip address. An important note to remember here is that I’ve configured another port for my Asterisk server, rather than 5060, that is often very highliy scanned for flaws. However, this configuration should work fine even with this different setup.

Next up – edit your pjsip.conf – I have a very compact configuration myself together with another peers, to keep the rows simple to edit. With the other base peers I’ve also managed to confirm that another SIP peer like Skype actually works. I’m in Sweden, so I have a swedish number. In this case, we’ll pretend I’ve got a number in Helsingborg (042). Together with the username from Skype, the configuration is set like below.

[skype-0421234567]
 type=registration
 outbound_auth=skype-0421234567
 server_uri=sip:99051XXXXXXXXX@sip.skype.com
 client_uri=sip:99051XXXXXXXXX@sip.skype.com
 transport=transport-udp
 ;Is the contact_user here really necessary?
 contact_user=<my_own_sip_id>
 [skype-0421234567]
 type=auth
 auth_type=userpass
 username=99051XXXXXXXXX
 password=THE_SKYPE_PASSWORD
 realm=sip.skype.com
 [skype-0421234567]
 type=endpoint
 context=in-0421234567
 allow=!all,g722,ulaw,gsm
 from_domain=sip.skype.com
 from_user=99051XXXXXXXXX
 aors=skype-0421234567
 tone_zone=se
 outbound_auth=skype-0421234567
 [skype-0421234567]
 type=aor
 contact=sip:99051XXXXXXXXX@sip.skype.com
 [skype-0421234567]
 type=identify
 endpoint=skype-0421234567
 match=sip.skype.com

And since I actually have a transport layer in there, I should probably show an example of that one too.

[transport-udp]
 type=transport
 protocol=udp
 bind=external_server_ip:external_ip_port
 external_media_address=external_server_ip
 external_signaling_address=external_server_ip

So. What now? I’m done? No. There’s more to think of. How to make calls and how to receive them. I actually have an [inbound]-context where everything happens (which should be changed later on). However, to receive calls in Asterisk, you’ll put an extension that matches your phone number when Skype sends it to you. Like this:

exten => 46421234567,1,Answer
exten => 46421234567,n,NoOp(${CALLERID})
exten => 46421234567,n,Wait(1)
exten => 46421234567,n,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${STRFTIME(${EPOCH},,%y%m%d%H%M%S)})
exten => 46421234567,n,Monitor(wav,${CALLFILENAME})
exten => 46421234567,n,BackGround(PlayBeforeCalling)
exten => 46421234567,n,Dial(PJSIP/SIP_CONFIGURED_MOBILE&PJSIP/SIP_CONFIGURED_HOME_PHONE&PJSIP/LINPHONE_AT_LINUX,30,wWkKm)
exten => 46421234567,n,VoiceMail(INTERNAL_EXTENSION_VOICEMAIL_ID,u)
exten => 46421234567,n,Hangup

As you can see above, there’s a bit of mumbo jumbo. This is used for a few reasons. I’d like to monitor all in- and outbound calls and record them as wavefiles. That’s why they are tagged with extension, caller id and a timestamp. However, it is in Sweden required to tell callers that they are recorded, so that’s what the PlayBeforeCalling is made for.

That was the inbound part. The outbound part is as easy as the inbound set up. It is however configured in another context. For the outgoing calls. As I use another phone number as the default exit point, I’ve added a prefix to the Skype number. The Skype number is also limited to Sweden and has to be in the format of E.123. This is not necessary, but if you want to use a Skype number ”as is” you also have to include the country code in the mentioned format (i.e. +46421234567). I solved this by only using the number in my own country. The rule for this number is that I have to hit ”90” before the real number. So if I want to dial 042654321 I use 90042654321 to reach out). Doing this generic with only ”+” before the number is way too much job and would look like 904642654321. There will be in short too much number to remember to not forget… So here is the outbound configuration for Skype.

To be real safe, I also set up the caller id number as my phone number. And of course – I’m starting to monitor outbound numbers also. Like this:

[outbound]
 exten => _90X.,1,Set(CALLFILENAME=${EXTEN}-${CALLERID(num)}-${STRFTIME(${EPOCH},,%y%m%d%H%M)})
 exten => _90X.,n,Monitor(wav,${CALLFILENAME})
 exten => _90X.,n,Set(CALLERID(num)=+46421234567@sip.skype.com)
 exten => _90X.,n,Dial(PJSIP/+46${EXTEN:3}@skype-0421234567,,rwWkK)
 exten => _90X.,n,Hangup

I think this is it. There’s a lot more configuration so please tell if something is missing or failing. Unfortunately there’s to few PJSIP-configuration examples out there…