oshogbo web https://www.oshogbo.vexillium.org oshogbo - My place in space FreeBSD upgrade procedure using GPT You have a few different ways to upgrade your operating system. For example, if you are using ZFS as your root file system you can use boot environments to accomplish this task in a quick, simple and safe way. Boot environments are the new ‘it’ thing in FreeBSD. However, today we will discuss a more old-school approach to this problem using the GPT flags. This approach may be used to upgrade your operating system if you don't use ZFS, and you want your system to be on the read-only partition, for example when you are building an appliance. https://www.oshogbo.vexillium.org/blog/62/ https://www.oshogbo.vexillium.org/blog/62/ Feb. 1, 2019, 1:34 a.m. BSD PL #9 In January it&rsquo;s time for our 9th Polish BSD User Group! <p>This time I would like to invite you to a special edition in which instead of three different 15 minute talks, we will have an hour-long tutorial. The whole meeting will be about FreeBSD jails, in particular about managing them with iocage.</p> https://www.oshogbo.vexillium.org/blog/61/ https://www.oshogbo.vexillium.org/blog/61/ Jan. 21, 2019, 5:08 p.m. [PL] ZFS – rewolucja w systemach plików Wiele lat temu zafascynowałem się systemem plików ZFS. W 2015 roku popełniłem artykuł na łamach świetnego polskiego czasopisma - Programista. Minęło już kilka dobrych lat od publikacji więc czas się nim podzielić na moim blogu :) <br> <br> Artykuł ma już kilka lat natomiast uważam że wiedza w nim zawarta jest wciąż aktualna. Mój artykuł opisuje podstawy ZFS - czym jest, mechanizmy ZFSa oraz API dostępne dla programistów. https://www.oshogbo.vexillium.org/blog/60/ https://www.oshogbo.vexillium.org/blog/60/ Jan. 20, 2019, 1:56 p.m. 2018 Recap Throughout December I took a break from writing blog posts, but New Year is a good moment to get back to it. Today will be a very personal post in which I will tell you a summary of my accomplishments over the previous year. I think I was quite productive. Do you? https://www.oshogbo.vexillium.org/blog/59/ https://www.oshogbo.vexillium.org/blog/59/ Jan. 9, 2019, 10:02 p.m. Games on FreeBSD What do all programmers like to do after work? Ok, what do most programers like to do after work? The answer is simple: play a good game! Recently at the Polish BSD User Group meetup mulander was telling us how you can play games on OpenBSD. Today let’s discuss how this looks in the FreeBSD world using the “server only” operating system. https://www.oshogbo.vexillium.org/blog/58/ https://www.oshogbo.vexillium.org/blog/58/ Nov. 20, 2018, 8:47 p.m. Capsicum I spent a couple of years evangelizing about Capsicum. I wrote many articles about it. So, it is very natural that I would also like to update you on this blog about the progress of the Capsicum project in FreeBSD, because this is what I’m doing in my free time. That said I feel that this blog wouldn’t be completed without some introduction to what Capsicum is. This post should fill this gap. Over the next weeks and months we will extend this topic and discuss different parts of Capsicum. Without further introduction let’s jump into the topic. https://www.oshogbo.vexillium.org/blog/57/ https://www.oshogbo.vexillium.org/blog/57/ Nov. 8, 2018, 5:25 p.m. Better looking assertions in C Assertions are very important for developers, because they help developers to find bugs. This concept should be used to check that the internal state of our application is correct. Some developers even measure a quality of the project/code based on the amount of assertions. In many programs assertions are enabled only in developer modes and not in production. Programmers should always remember that assertion can’t be used to validate user input because it can introduce some bugs into the code. Although this topic is very interesting this is not what we will talk about today. Today let’s discuss how to make our assertions be even more useful. https://www.oshogbo.vexillium.org/blog/56/ https://www.oshogbo.vexillium.org/blog/56/ Oct. 12, 2018, 9:05 p.m. Polish BSD User Group In a couple days there will be another meeting of the Polish BSD User Group! It’s already our 6th meeting, which means that the group has been running for almost half a year. The next meeting will be a special one, because we will be guests at Warsaw University of Technology! Considering all of this I decided to summarize our accomplishments. https://www.oshogbo.vexillium.org/blog/55/ https://www.oshogbo.vexillium.org/blog/55/ Oct. 3, 2018, 8:03 p.m. Process title and missing memory space It’s amazing what happens when you do any kind of research. Many times, you find a few interesting things around one topic you are looking into. First, I published a post about changing a process name which describes how it can be accomplished on different operating systems. This was the main point of my research. Then I described how to install other operating systems using grub2-bhyve on bhyve hypervisors. Today, the last topic is somewhat related to them. When I was looking at the process title it was easy to notice that the kernel needed to read some piece of memory from it. What would happen if the memory region didn’t exist? https://www.oshogbo.vexillium.org/blog/54/ https://www.oshogbo.vexillium.org/blog/54/ Sept. 22, 2018, 11:06 a.m. OpenBSD/NetBSD on FreeBSD using grub2-bhyve When I was writing a blog post about the process title, I needed a couple of virtual machines with OpenBSD, NetBSD, and Ubuntu. Before that day I mainly used FreeBSD and Windows with bhyve. I spent some time trying to set up an OpenBSD using bhyve and UEFI as described here. I had numerous problems trying to use it, and this was the day I discovered the grub2-bhyve tool, and I love it! https://www.oshogbo.vexillium.org/blog/53/ https://www.oshogbo.vexillium.org/blog/53/ Sept. 16, 2018, 6:24 p.m. MeetBSD and SecurityBsides In October there will be two very interesting conferences at which I'm honored to give a talk. https://www.oshogbo.vexillium.org/blog/52/ https://www.oshogbo.vexillium.org/blog/52/ Sept. 11, 2018, 9:45 p.m. How does the process title works? Let's start by defining what the title of a process is - in this article, we will understand the name reported by ps(1)/top(1). When we are creating a new process using fork(2) the process inherits the name from its parent. In the scenario when we call exec(2) function we also pass the list of the arguments for a process, which will be treated as a process title. What if we would like to change the title of the process when it's running? It turns out that many operating systems do it in a different way. In this article we will discuss how open source operating systems like FreeBSD, Linux, OpenBSD, NetBSD, and DragonFlyBSD do it. https://www.oshogbo.vexillium.org/blog/51/ https://www.oshogbo.vexillium.org/blog/51/ Sept. 1, 2018, 12:43 p.m. FreeBSD lockless algorithm - seq Those days locking algorithms are critical for operating systems, especially in a multi-threaded world. With time it turns out that classical locks, like mutex, are performance costly. Even when we are using techniques like having reads and writes mutex, synchronizing the state between CPUs can be costly. To optimize some cases, the lockless algorithm started to be used. https://www.oshogbo.vexillium.org/blog/50/ https://www.oshogbo.vexillium.org/blog/50/ Aug. 17, 2018, 11:56 p.m. GameDev archive Many years ago, I was very interested in creating games. Unfortunately, I resigned from this path for my career. When I look back, this was one of the best methods for me to learn to programme. After many lines of codes, you are getting something that you can show anybody, and they will understand what you created which was very motivating. There are many, many algorithms which you must understand and implement. In my time, when web games weren’t yet very popular, this was also a great environment for me to learn C++ and C - which I use today. On the other hand, the language doesn't really matter - if you want to learn a new language why not to write a game in it. Today almost every language has graphics libraries you can use. Don't limit yourself and don't be afraid to scratch your own framework. If you are looking for something to implement and you are new in computer science, with a clear conscience, I recommend you create a remake of your favorite game. https://www.oshogbo.vexillium.org/blog/49/ https://www.oshogbo.vexillium.org/blog/49/ Aug. 10, 2018, 10:20 p.m. The template user with PAM and login(1) When you build a new service (or an appliance) you need your users to be able to configure it from the command line. To accomplish this you can create system accounts for all registered users in your service and assign them a special login shell which provides such limited functionality. This can be painful if you have a dynamic user database. https://www.oshogbo.vexillium.org/blog/48/ https://www.oshogbo.vexillium.org/blog/48/ Aug. 3, 2018, 7:11 p.m. Introduction to nvlist part 4 - cnvlist The nvlist is a very useful container but, sometimes, using the name of an element to fetch it may be less than optimal, or even impossible. Let us consider two scenarios: <br/> - We are traversing a list which was created with an NV_FLAG_NO_UNIQUE flag. <br/> - We are traversing very large list. https://www.oshogbo.vexillium.org/blog/47/ https://www.oshogbo.vexillium.org/blog/47/ July 27, 2018, 10:58 p.m. zpool checkpoints In March, to FreeBSD landed a very interesting feature called 'zpool checkpoints'. Before we jump straight into the topic, let's take a step back and look at another ZFS feature called ‘snapshot’. Snapshot allows us to create an image of our single file systems. This gives us the option to modify data on the dataset without the fear of losing some data. https://www.oshogbo.vexillium.org/blog/46/ https://www.oshogbo.vexillium.org/blog/46/ July 20, 2018, 9:23 p.m. Introduction to nvlist part 3 - simple traversing Nvlist allows us to keep pairs (name, value). The question for today is what if the name of an element is unknown? Or what if there is a need to traverse over all elements on a list? First of all there is the nvlist_next() function. This function allows to iterate over one single list. The return value is the name of the next element on the list or NULL if the list is ends. The additional information which is returned by this function is the type of the element. Thanks to these two values (the name of the element and it’s type) we can decide which function to use. The last element is secret cookie which refers to the position where we are on the list. At the beginning the cookie needs to be initialized by NULL otherwise the program will behave abnormally. https://www.oshogbo.vexillium.org/blog/45/ https://www.oshogbo.vexillium.org/blog/45/ Oct. 31, 2017, 11:17 p.m. Introduction to nvlist part 2 - dnvlist One of the assumptions of nvlist is that during fetch functions (like get or take) an application knows what elements are on the list, otherwise read operations fail and the application will be aborted. If an element is optional then it is necessary to check if the element exists using the exist functions. https://www.oshogbo.vexillium.org/blog/43/ https://www.oshogbo.vexillium.org/blog/43/ Oct. 24, 2017, 7:16 p.m. Introduction to nvlist part 1 Nvlist is an implementation of a general purpose container based on a list which contains pairs (name, value). The idea behind this library is borrowed from the Solaris library which has the same name. In Solaris nvlist is used for example, by the ZFS. In FreeBSD nvlist exists in kernel and userland. Nvlist was implemented to provide an easy inter-process communication framework for applications that will be privileged separated and later sandboxed, due to this in userland there are functions allowing us to send nvlist over the Unix domain socket, in that case there is also a possibility to send descriptors with nvlist. https://www.oshogbo.vexillium.org/blog/42/ https://www.oshogbo.vexillium.org/blog/42/ Oct. 17, 2017, 11:13 p.m. Magical initialization in for loop Recently one of my friends had a strange problem - he wanted to initialize a few variables with a different type in a single for loop. What was even more strange was that he wanted to declare just one of them and both of them have different type. A declaration of variables is forbidden in the loop for C standard which are older than C99, so let’s assume we are using exactly that standard. One of the questions could be “why is your friend so crazy that he would want to do that” - basically he wanted to create a macro which would declare for him a head of the loop very similar to what STAILQ_FOREACH. https://www.oshogbo.vexillium.org/blog/41/ https://www.oshogbo.vexillium.org/blog/41/ Nov. 30, 2016, 5:45 p.m. A fairy tale about solving security problems I had the pleasure of giving talks at two great BSD conferences - BSDCan and AsiaBSDcon. The first one was held in June at the University of Ottawa, Canada and the second one was in March at the Tokyo University of Science, Japan. https://www.oshogbo.vexillium.org/blog/40/ https://www.oshogbo.vexillium.org/blog/40/ Sept. 30, 2016, 10:09 p.m. Bhyve NFS boot bhyve is a hypervisor for FreeBSD. A few weeks ago I gave it a try and I must admit I was very impressed, so much that I decided to write a short tutorial on how to configure bhyve to boot from NFS filesystem. So lets start. https://www.oshogbo.vexillium.org/blog/39/ https://www.oshogbo.vexillium.org/blog/39/ Nov. 22, 2015, 10:09 p.m. BSDCam 2015 Trip Report I'm a fresh FreeBSD committer who is very interested in security things. I also work for the Wheel Systems company which develops security solutions. So it was natural for me that I should attend Cambridge Developer Summit which, in my opinion, is the most security related event in every committer’s calendar. This was also my third visit to Cambridge. For the first one I also wrote a trip report which you can find here. The conference was held in August 17-20, 2015. https://www.oshogbo.vexillium.org/blog/38/ https://www.oshogbo.vexillium.org/blog/38/ Oct. 20, 2015, 11:02 p.m. [PL] Compo IGK'2014 To już ponad miesiąc po IGK'2014. Czas ożywić bloga krótką relacją z tego wydarzenia. Jak co roku w Siedlcach w Instytucie Informatyki na Wydziale Nauk Ścisłych Uniwersytetu Przyrodniczo-Humanistycznego odbyła się konferencja poświęconej "inżynierii gier komputerowych". Miałem okazję być na tej konferencji już po raz siódmy. https://www.oshogbo.vexillium.org/blog/37/ https://www.oshogbo.vexillium.org/blog/37/ June 1, 2014, 2:27 a.m. Presentations Today I would like to share with you some of the presentations which I made in last couple of months. Some of them are only available in Polish other in English. I hope everybody will find something for himself. All presentations was made at Warsaw University of Technology but all of them on different occasions. https://www.oshogbo.vexillium.org/blog/36/ https://www.oshogbo.vexillium.org/blog/36/ March 11, 2014, 12:50 p.m. FreeBSD DevSummit 2013 Some time ago I post my trip report to the Freebsd Foundation, now its time to post it here. Orginal post you can find&nbsp;<a style="font-family: 'Open Sans', Helvetica, Segoe, sans-serif; font-size: 16px; font-style: normal;" href="http://freebsdfoundation.blogspot.com/2013/09/cambridge-devsummit-trip-report-mariusz.html">here</a>. I was invited to the Cambridge DevSummit. Cambridge University is closely related to my&nbsp;<a style="font-family: 'Open Sans', Helvetica, Segoe, sans-serif; font-size: 16px; font-style: normal;" href="https://wiki.freebsd.org/SummerOfCode2013/CapsicumFeatures">GSoC project</a>&nbsp;because this is the place where Capsicum was born and the initial implementation created by Robert Watson and his team. https://www.oshogbo.vexillium.org/blog/33/ https://www.oshogbo.vexillium.org/blog/33/ Oct. 8, 2013, 2 a.m. FreeBSD diskless on VirtualBox Firstly what is FreeBSD diskless? FreeBSD diskless is an operating system that will boot on your computer (or virtual machine) over the network. There are many situations in which you probably want to use such a configuration. For example if you are a computer science teacher you could configure one system in your class and make other computers use it over the network. In another situation you could need some laboratory to play a little with the FreeBSD kernel.This configuration has a lot of benefits. For example you don't have to restart your developer machine every time you compile the kernel or worry that you broke your kernel and you will not have a developer machine any more. If you know me a little you probably know that I'm not a computer science teacher. https://www.oshogbo.vexillium.org/blog/28/ https://www.oshogbo.vexillium.org/blog/28/ Sept. 23, 2013, 2 a.m. [PL] IGK 2013 Compo - o naszej grze <p><strong style="font-family: 'Open Sans', Helvetica, Segoe, sans-serif; font-size: 16px; font-style: normal;">(collaborative post by&nbsp;<a style="font-size: 16px;" href="http://gynvael.coldwind.pl/?id=504">Gynvael</a>, oshogbo &amp; xa)</strong><br /> W Siedlcach odbyła się co roczna konferencja Inżynierii Gier Komputerowych (IGK) - tym razem była to jubileuszowa, 10siąta, edycja. I jak co roku było teamowe compo - 6.5h (ostatecznie przedłużone o jeszcze godzinę) na zrobienie gry na zadany temat w maksymalnie 4 osoby. Tematem było "Artillery Game" (więcej poniżej), a alians Vexillium + Dragon Sector (reprezentowany przez 6 os&oacute;b na IGK) wystawił dwa teamy po 3 osoby (pod nazwami "Bad Sectors" oraz "Dragons"). Ostatecznie obu naszym teamom udało się stworzyć w pełni działające i ukoączone gry (bugi przemilczmy ;p), i zając&nbsp;<strong style="font-family: 'Open Sans', Helvetica, Segoe, sans-serif; font-size: 16px; font-style: normal;">pierwsze</strong>&nbsp;oraz&nbsp;<strong style="font-family: 'Open Sans', Helvetica, Segoe, sans-serif; font-size: 16px; font-style: normal;">piąte</strong>&nbsp;miejsce na 12 drużyn. W niniejszym poście chcieliśmy coś napisać o grze naszego teamu z pierwszego miejsca (w składzie: code: gynvael+oshogbo, gfx: xa), a także udostępnić grę w wersji post-compo (razem ze źr&oacute;dłami na MIT i grafiką na CC) oraz port gry na HTML5 kt&oacute;ry zrobił Xa w ciągu ostatnich paru wieczor&oacute;w. Miłej lektury (tak, są obrazki) :)</p> https://www.oshogbo.vexillium.org/blog/17/ https://www.oshogbo.vexillium.org/blog/17/ May 5, 2013, 2 a.m. Hello in the new year! It's publishing Time! I haven't forgotten about this place, but also I didn't think that writing technical post would be so hard in English. I hope I get some practice and will become much better. Today is the perfect day to write a new blog post. https://www.oshogbo.vexillium.org/blog/16/ https://www.oshogbo.vexillium.org/blog/16/ Jan. 6, 2012, 1:29 p.m. Android graphics alternative The standard method of using graphics is to use Canvas and Drawable and other funny things that I don't like (you can read about it at&nbsp;<a style="font-size: 16px;" href="http://developer.android.com/guide/topics/graphics/2d-graphics.html">here</a>). The other way to read graphics in android is using "assets". What is it? https://www.oshogbo.vexillium.org/blog/15/ https://www.oshogbo.vexillium.org/blog/15/ Dec. 10, 2011, 10:46 a.m. [PL] How play Mario? Ugh, zaczyna się robić tłoczno, drugi post w przeciągu dwóch miesięcy, nie jest źle ;](warto dodac że post pojawia się za namową pewnej osoby (Pozdro Gyn ;>))... Dzisiaj opisze projekt nad którym ostatnio pracowałem. Pomysł użycia tej technologi chodził za mną już od igk ale dopiero ostatnio zrobiłem coś co by się nadawało do pokazania publicznie. https://www.oshogbo.vexillium.org/blog/11/ https://www.oshogbo.vexillium.org/blog/11/ Nov. 7, 2009, 1 a.m.