Example smb.conf

# This is the main Samba configuration file. You should read the # smb.conf(5) manual page in order to understand the options listed # here. Samba has a huge number of configurable options (perhaps too # many!) most of which are not shown in this example # # Any line which starts with a ; (semi-colon) or a # (hash) # is a comment and is ignored. In this example we will use a # # for commentry and a ; for parts of the config file that you # may wish to enable # # NOTE: Whenever you modify this file you should run the command "testparm" # to check that you have not made any basic syntactic errors. # #======================= Global Settings ===================================== [global] netbios name = David workgroup = WORKGROUP server string = David wins support = true dns proxy = no hosts allow = 192.168.1. security = user map to guest = Bad User default service = global #server signing = mandatory ; Doesn't seem to work on OSX #log level = 2 log file = /var/log/samba/%m.log max log size = 50 public = yes available = yes browseable = yes only guest = yes read only = yes ; Disable printers load printers = no printing = bsd printcap name = /dev/null show add printer wizard = no disable spoolss = yes #============================ Share Definitions ============================== [ftp] comment = Public Stuff path = /var/ftp/public read only = no directory mask = 5777 create mask = 5677

April 27, 2015  |  🏷️Samba 🏷️Cifs

Enabling read/write to USBHID

Add read/write for group plugdev echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0664", GROUP="plugdev"' | sudo tee /etc/udev/rules.d/99-hidraw-permissions.rules # Check that you have the group plugdev groups # If you cannot see plugdev there, type this: sudo usermod -aG plugdev $USER # Now it should work (otherwise reboot or replug usbhid device)

Installing Teamspeak3 Server

Download tarball from www.teamspeak.com Untar to /home/teamspeak Add user/group teamspeak Run the init as teamspeak sudo su - teamspeak ./ts3server_minimal_runscript.sh createinifile=1 Configure ts3server.ini Make sure you can start it (then ^C to kill it) ./ts3server_startscript.sh start Create /etc/systemd/system/teamspeak.service [Unit] Description=Teamspeak server After=network.target [Service] User=teamspeak Group=teamspeak Type=forking PIDFile=/home/teamspeak/ts3server.pid ExecStart=/home/teamspeak/ts3server_startscript.sh start [Install] WantedBy=multi-user.target Test it through systemctl and then enable it sudo systemctl start teamspeak.service sudo systemctl enable teamspeak.service

March 21, 2015  |  🏷️Systemd

Git Cheatsheet

Things about git which I sometimes forget Recovering from a spaghetti branch Different ways of handling when you’ve branched from a branch, which later gets merged to a branch which you also want to merge to. rebase –onto You have created CURRENTBRANCH from OLDBRANCH which later got merged into NEWBRANCH. Now you want to clean up OLDBRANCH branch to reflect the real changes based on NEWBRANCH before a pull request. ...

March 19, 2015  |  🏷️Git

Archlinux: Installing from AUR

Links Official Guide Before you start Make sure you’ve configured /etc/makepkg.conf Download the package’s PKGBUILD-file from AUR (under View PKGBUILD under Package Actions on the right side) Making Put the PKGBUILD-file in a separate folder, maybe $HOME/tmp cd to the folder run makepkg -s a. Does it want you to install any application? Press yes b. Does it need some other package from AUR? Install that first You should now have a pkg.tar.xz-file. Run pacman -U that.file.name.pkg.tar.xz

Crazy Chameleons Game

About During the christmas of 2014 I was over at my in-laws’ place. There I found this game, where you have 9 tiles, organized in a 3x3 grid, and the goal was to swap or rotate the witches so that all witches have the correct color and orientation. At first I thought it would be really easy, but I never managed to solve it on my own, instead I wrote a small program brute-forcing the solution. ...

MongoDB Cheatsheet

Starting: mongo Connect to database show dbs use local See database tables show collections db.funnytable.find() Regex db.funnytable.find( $or: [ {'name': { $regex: req.params.username, $options: 'i' }}, {'username': { $regex: req.params.username, $options: 'i' }}, {'email': { $regex: req.params.username, $options: 'i' }} ])

October 28, 2014  |  🏷️Mongo

BSD - Fetch and update ports

portsnap fetch update # Upgrade ports to newest version portmaster -ad # ALL ports portmaster -d portname # Specific port # List upgradable ports portmaster -L

Building debian packages

Links Official Manual Example building sudo-1.8.11p1-2 # Download the source files curl -O http://ftp.de.debian.org/debian/pool/main/s/sudo/sudo_1.8.11p1-2.dsc curl -O http://ftp.de.debian.org/debian/pool/main/s/sudo/sudo_1.8.11p1.orig.tar.gz curl -O http://ftp.de.debian.org/debian/pool/main/s/sudo/sudo_1.8.11p1-2.debian.tar.xz # Extract the tarballs: tar xf sudo_1.8.11p1-2.debian.tar.xz # Creates folder sudo-1.8.11p1 tar xf sudo_1.8.11p1.orig.tar.gz # Creates folder debian # Move the debian file to the source mv debian sudo-1.8.11p1 # Cd to the folder cd sudo-1.8.11p1 # Build dpkg-buildpackage -us -uc

October 27, 2014  |  🏷️Curl 🏷️Tar 🏷️Dpkg

LaTeX Template

LaTeX Template: \documentclass[a4paper,11pt]{article} \usepackage[utf8]{inputenc} \author{Author Name} \title{This is the title} \begin{document} \maketitle \section{Section Title} Wow, text \flushleft More Text\\[10pt] Text \end{document}

October 27, 2014  |  🏷️Latex