Lycka till, höstens Nationer!

Till hösten kommer det hända en massa saker på Nationernas Hus och inom Nationslivet. Ett par nedlagda nationer kommer startas upp och barlagen på NH kommer inte längre vara barlag – en grupp människor som jobbar på NH kommer istället att vara representanter för en Nation.

Som gamling (sedan 2006) tänkte jag bidra med några tips till de nya Nationerna, men även de nationer som funnits sen tidigare kan läsa och dra nytta av detta.

Satsa på mångfald!

Början av hösten är ALLTID den tiden då Nationerna rekryterar flest medlemmar. Satsa på fester och event som alla kan vara med på och som inte kostar så mycket för den enskilda medlemmen. Det är viktigare att dra med folk i början än att få in pengar till kassan. Att be medlemmarna ta med sina vänner (som inte är medlemmar) är också väldigt effektiv rekrytering.

Våga synas!

Målet med höstens början är att lära alla nyblivna studenter vad en Nation är för något – oavsett om de går med i Nationen eller ej. Var påhittig och ta vara på alla möjligheter att synas inför “nollorna”. Delta i nollningsevent, sätt upp affischer eller bjud på kaffe i nåt fik!

Ditt liv är ett Nationsevent!

Okej, det var lite överdrivet. Men kanske du inser en dag att de flesta du umgåtts med under studietiden och gjort de konstigaste sakerna med har träffat dig genom Nationen. Så har det varit för mig iallafall, utan tvekan. Satsa därför på Nationslivet. Gör din hemmafest till ett Nationsevent. Vill du börja träna – ta tag i Nationssporten. Vill du se en film, skriv i medlemsmailet att Nationen går på bio.

Ha koll på vad en Nation har rätt till!

Behövs pengar eller PR-material, gå till Nationernas Förbund (Presidiemötet). Affischer kan du trycka upp själv helt gratis via Umeå Studentkår – fråga NF om vår kod till färgkopiatorn.
Varje 1Q ska ha en nyckel till NH – hör med NH-styret. Kan vara riktigt nice med nyckel om man vill ha spel/filmkväll för Nationen.

Håll på traditionerna!

Det viktigaste en Nation har är dess traditioner. Nu har Nationerna i Umeå bara funnits i ~20 år men ändå. Alla Nationer har nåt de står för, och ofta ett event som varje styrelsemedlem vet att det SKA hända någon gång under året. Släpp inte det som finns utan uppmuntra hellre. En nystartad Nation kan hämta inspiration i Bunkern bland gamla dokument.

Låt inte tekniken sinka er – dra nytta av den istället!

Vi vet alla att det är krångligt med protokoll och dagordningar, att renskriva anteckningar och så vidare. Och sen ska ju allt sparas nånstans där framtida styrelser kan läsa det. Ack, ack, vad detta är jobbigt. Eller?
GH-Dala har under flera år använt Google Docs för att hantera alla dokument (tack till Ola Andersson som införde detta). Idag har åtminstone en i styrelsen med sig bärbar dator, skriver protokollet direkt in i ett Google-Dokument som automatiskt sparas och finns tillgängligt för alla i styrelsen (och framtida styrelser) via nätet. Byt till idag om ni vill spara tid och slippa krångel i styrelsearbetet.
Ett annat tips är WordPress för Android eller WordPress för iOS om ni har en WordPress-webbplats. Ta ett foto med mobilen då ni är ute och härjar på ett Nationsevent, tryck “Dela” och sedan kan du ladda upp fotot till webbsidan. Kan inte bli mycket smidigare.

Du ska lämna över imorgon!

Nej – det stämmer ju inte, tänker du som sitter i styrelsen. Byte av styrelse sker typ en gång per år så du behöver inte oroa dig ännu. Men om du har samma inställning som rubriken menar så kommer många saker gå mycket smidigare (framför allt själva överlämningen). Att hitta en student som kan fylla upp din post efter dig kan faktiskt ta längre tid än en termin. Granska därför varje ny medlem du rekryterar och ställ dig frågan “Är detta styrelsematerial?”.
Jag går tillbaka till tekniken en sväng. Att lämna över tekniska saker (hemsideansvar, digitalkamera etc) en gång per termin är för det mesta jobbigt. Skippa därför det jobbiga. När styrelsen köper in en kamera – välj den kameran som är lättast att förstå sig på. Ska ni byta webbansvarig – då är det bra om hemsidan är lätt att fixa med (t.ex. WordPress som nästan alla använt förut). Sammanfattat: Försök göra överlämningen till nästa styrelse så enkel som möjligt, oavsett vad det handlar om.

Ha nu en askul höst,
önskar en gammal Nationsräv

A turbulent summer for friendship-bracelets.net

My biggest site, friendship-bracelets.net, went down two times this summer (I hope it’ll stay up now). I’ll tell you some more about what happened.

On the 7th of July, my web host One.com suddenly shut my account down. Their reason was that my site loaded their servers too much. They told me that they have several customers per server machine and that my site affect these other customers by slowing their sites down. They did not tell me much about how I could change my site to make it load the servers less, but I knew that the MySQL part of the site was quite heavy. You might remember this scary message:
User friendship_brac has already more than 'max_user_connections' active connections

So, what did I do? I quickly googled some swedish web hosts that were quite cheap but had better performance than One.com’s servers. The best result I got was Binero.se. I got an account and I could upload the site immediately. Sweet.

For a few days the site could be reached via the Binero preview address, friendship-bracelets.net.preview.binero.se, since the domain transfer took way too long time than the users wanted to wait.

The 22th of July, Binero.se shut me down. Why? Too much load on the servers. Surprise surprise. I tried, really tried to optimize my code to run fewer MySQL queries but I realized it wasn’t enough.

Therefore, I set up my new computer at home (which I bought from PayPal donations, props to the donors!) as a web server. The domain was easily pointed from the web space at Binero.se to my local machine in my living room. A day of tweaking later it worked quite well. The only thing that was a bit strange was the server speed. I looked at the server stats and saw that the memory usage was about 100%, so I bought some more memory. The machine have 12Gb of memory now, which is much for a home PC.
To make the computer actually use the extra memory, I had to tweak some parameters in the MySQL and Apache2 server setting files.

For Mysql, I increased the values of these parameters in /etc/mysql/my.cnf:

query_cache_size
table_cache
max_connections

Yes, I can now edit the “max_connections” value, which is a great freedom to have. For Apache2, I increased the values for these parameters in /etc/apache2/apache2.conf:

ServerLimit
MaxClients

This made the server accept more connections per second, and therefore it has to use a larger portion of the server memory. I increased these values a bit, checked the error logs in /var/log/apache2/error.log to see if the MaxConnections limit was exceeded, and repeated. At the moment the server uses about half of the memory, so I should be able to increase these values a bit more in the future.

The server runs very fast. So fast that I got several comments on it:

I can’t believe how FAST the site is again. Congratulations to Stefan, you seem to be a magician! 🙂 🙂 🙂

Website is working much faster today! more memory must have been added!

One good thing that all this mess brought was that my blog got some more hits. I guess the users Googled for “friendship-bracelets.net” when they couldn’t connect to it, and of course they got my blog up in the top results. Below you can see the number of visitors to Steffe.se during the same time period as the graph earlier. Note its shape and compare it to the other graph.

Thanks to all patient and supportive users. Love ya.

Setting up a local Ubuntu Linux machine to send email via SMTP in PHP

The following guide worked on an Ubuntu 11.04 machine.

I will assume you have an Apache2 server up and running without problems. If this is not the case, search the Ubuntu forums for LAMP.

Begin with installing the packages sendmail, php-mail and postfix:

sudo apt-get install sendmail php-mail postfix

You might get some prompts during the installation, but just follow the instructions.

Uncomment and change the sendmail_path in your file /etc/php5/apache2/php.ini. The line should now look like this:

sendmail_path = /usr/sbin/sendmail -i -t

This is needed because PHP won’t find the sendmail command otherwise.

You can either use the PHP mail() function now, or use a custom PHP library for sending emails. I recommend the latter. For a fast setup, use the Swift Mailer. Download the library, put it in your public website folder and start making scripts. Here is an example script that uses Swift:

require_once 'swift/lib/swift_required.php';

// --- Create the Transport ---
$transport = Swift_SmtpTransport::newInstance('smtp.yourdomain.com', 587)
  ->setUsername('')
  ->setPassword('yourpassword');

// --- Create the Mailer using your created Transport ---
$mailer = Swift_Mailer::newInstance($transport);

// --- Create a message ---
$message = Swift_Message::newInstance($subject)
  ->setFrom(array('' => 'Your Name'))
  ->setTo(array(''))
  ->setBody('This is the message body.');

// --- Send message ---
$status = $mailer->send($message);
if($status) echo "Success!";
else echo "Failure";

Put this code into a PHP file, change the domain and SMTP server data, and run it. Hopefully, an email should be sent to the given e-mail address.

Friendship-Bracelets.net is temporarily down!

Update: A temporary site has been setup at: http://friendship-bracelets.net.preview.binero.se

This site has been suspended.

I’m sorry to announce it, but this is the case. I’ll do what I can do bring it back up as soon as possible. I can’t control this downtime since the site sits on a remote web hotel.

I am very keen on switching to some other web hotel. For a “big” customer like me, this current one seem to have too many problems and is quite unsafe. They can’t offer a larger account for me either! Anyway – stay connected via !

This is the answer I got from my current web host when I asked for the reason why they suspended me.

Hello Stefan,
Your site was suspended because your site was causing too much load on
the database server. You must fix your script to reduce the database
load and minimize the database queries.
Best Regards
SUPPORT

Of course, the database load is proportional to the number of visitors. Which is a very big number. I see no other solution than moving to some other web host. I guess that will be the project for this week and next.

Now I’ve bought some web space at Binero.se, a Swedish web host with good performance of servers and good reputation. Going from One.com to Binero.se will be a HUGE performance increase. As a user, you’ll probably feel the difference right away. This web hotel know know what they are doing – they’ve worked with big customers for ages. I took the smaller account and I think that will fit me just fine 🙂

Now I’m uploading all the old things to the new server. This will take a lot of time but I’ll do it for my users. The site can be reached from a random URL in the beginning, but the domain “friendship-bracelets.net” will point to it when the guys at One.com and the registrars have finished the work I gave them today.

bah! I’m having withdrawls!

I wanted to try making the bracelet buckle last night but the site shut down and I freaked out haha :p

‎:((( no no no no no… i cant wait…

im so nervous!! im like obsessed with this

WHY? ! I just started this braceletttttt. And now it is in hold. D;

I think being without friendship-bracelets.net is probably worse than being without facebook :p

image

Uploading thousands and thousands and thousands and *looks at watch* thousands and…. Yeah, I think you get it. I’ve already been sitting here for like three hours. The move to a new webhotel is painful but it will be a lot better when it’s done.

Update: A temporary site has been setup at: http://friendship-bracelets.net.preview.binero.se

Aiming for Youtube

image

This is my “studio” where I make friendship bracelet tutorials. I made two tutorials yesterday. When I get up to five or so, I’ll upload a vid to youtube.

I make the bracelets on the white paper to get a good background and I place my camera on that stick which is held up by some big books. Yes, there is a cocktail book on top 🙂

The channel is called The Forward Knot and you can reach it at http://www.youtube.com/user/forwardknot. It’s nothing there atm though.

SQL_BIG_SELECTS + One.com = Fail?

Unfortunately, Friendship-Bracelets.net went down a moment ago. I’m not exactly sure what I did but I’m sure it was me. I overloaded the MySQL server somehow.

I needed a long query for joining a LOT of tables in my new newsfeed implementation. I got an error from MySQL stating that my query was too long. Therefore I was suggested to run this query to enable longer queries.

SET SESSION SQL_BIG_SELECTS=1

I tried it locally on my computer and it went okay without any fuss. The error message because of long queries went away. I thought: Yay! and uploaded the new newsfeed app to the site and then POW:

User friendship_brac has already more than 'max_user_connections' active connections

What I learnt today? SQL_BIG_SELECTS shouldn’t be enabled on a One.com site with a lot of traffic.