Installera först MySQL och starta det. Sedan för att logga in första
gången: mysql -u root -p
Använd följande kommando för att skapa en användare med tillåtelse att göra allt:
CREATE USER 'david'@'localhost' IDENTIFIED BY '1234';
#include <iostream> | |
int choose(int n, int k) | |
{ | |
if(k > n) | |
return -1; | |
else if(k > n - k) | |
return choose(n, n - k); | |
else if(k == 1) | |
return n; |
superset [] = [[]] | |
superset (x:xs) = rest ++ [x : l | l <- rest] | |
where rest = superset xs |
--- config.def.h 2011-12-19 16:02:46.000000000 +0100 | |
+++ config.h 2014-12-16 18:56:14.428360000 +0100 | |
@@ -46,8 +46,8 @@ | |
#define SHCMD(cmd) { .v = (const char*[]){ "/bin/sh", "-c", cmd, NULL } } | |
/* commands */ | |
-static const char *dmenucmd[] = { "dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; | |
-static const char *termcmd[] = { "uxterm", NULL }; | |
+static const char *dmenucmd[] = { "~/dwm/install/usr/local/bin/dmenu_run", "-fn", font, "-nb", normbgcolor, "-nf", normfgcolor, "-sb", selbgcolor, "-sf", selfgcolor, NULL }; | |
+static const char *termcmd[] = { "mate-terminal", NULL }; |
#/bin/bash | |
# Authors Simon and David | |
# Go to the correct directory | |
mkdir ~/dwm | |
cd ~/dwm | |
# Download the things | |
wget http://dl.suckless.org/dwm/dwm-6.0.tar.gz | |
# Unpack the tar | |
tar xvf dwm-6.0.tar.gz |
#!/bin/bash | |
cd userprog/build | |
COUNTER=0 | |
while [ $COUNTER -lt 10 ]; do | |
echo Running the program for the $COUNTER time. | |
pintos -v --qemu -- -q run 'pfs' > output_$COUNTER | |
pintos -v --qemu -- -q cat messages > messages_$COUNTER | |
tail +12 messages_$COUNTER | head -313 | cut -c 60-75 | tr '\n' '\0' | tr '.' ' ' > messages_cropped_$COUNTER | |
echo "Number of words:" | |
wc messages_cropped_$COUNTER |
struct Wheel { | |
int number; | |
}; | |
struct Car { | |
struct Wheel* wheel_pointer; | |
struct Wheel wheel_instance; | |
}; | |
int main() { |
choose n 1 = n | |
choose n k | |
| k > n = -1 | |
| k > n - k = choose n (n - k) | |
| otherwise = ((choose n (k - 1)) * (n - k + 1)) `div` k |
#!/bin/python2 | |
# -*- coding: utf-8 -*- | |
# Author: David Bergström | |
# | |
# This script contacts the given gitlab servers and retreives a list | |
# of all git repositories the user has access to. It then proceeds and | |
# runs "git clone --mirror" on all the repositories, creating a backup | |
# of all the repositories. | |
# |