Jekyll2024-03-18T02:23:02+01:00https://blog.liz3.cat/feed.xmlLiz3 BlogLiz3Depression2024-01-07T00:00:00+01:002024-01-07T00:00:00+01:00https://blog.liz3.cat/depression<p>I’m not even sure where exactly to start here, who this is for or why exactly i’m writing it but supposedly it’s if you want to learn about the topic or hear my experiences with it, how it changed me and how i cope with relapse.</p>
<h2 id="what-is-depression">What IS depression</h2>
<p>This might seem unnecessary but its very important. In my experience the word “depression” is not only stigmatized but also misused a lot.
It’s, how do i put this, what people often call depression on a short notice isn’t depression. moreover its feelings of boredom, sadness or remorse. I don’t want in any way to discredit or downplay those feelings, they are very real and might well require treatment, but they are not depression.</p>
<p>So what is depression then?
Depression is uhmm, id say a collection of sensations and emotions that <strong>stay for a long time and affect your day to day live in noticeable negative ways</strong>.
There are a few common symptoms like:</p>
<ul>
<li>Social retraction</li>
<li>Fear</li>
<li>Sadness</li>
<li>Neglection of bodily needs</li>
<li>Sleep issues
…</li>
</ul>
<p>But the experience can also vary a lot from person to person and depression can present itself in a lot of different ways.</p>
<h2 id="how-did-it-start-for-you">How did it start for you</h2>
<p>I started getting actually depressed around May/June 2023, i can’t tell you exactly when because back then i didn’t know it was depression.
The sensation started with social retraction, i should add that i was always very introverted but during that time i pretty much turned into a <a href="https://en.wikipedia.org/wiki/Hikikomori">hikikomori</a>, for no particular reason other that i didn’t have a reason to be with others, i do have friends but these are not in my area and i didn’t have anyone else really here where i live.</p>
<p>The next what happened after 1-2 weeks was a deep feeling of sadness and pain in my chest, i was aware the pain was mental, don’t ask me why but i assume because it was always or often accompanied by this sadness. By this time social retraction has gotten to a point seeing even family members became a strain.</p>
<p>Shortly after i started with another very common depression effect: being unmotivated(but not that you don’t want to do something, you literally can’t make up the energy to do it even though you wan’t). I stopped working and also stopped programming entirely. Yes entirely, i could not bring myself to do them, even not for fun.
Added to that i also actively started with self harm, cutting myself specifically.
I only played Lost ark during that time out of habit and it was a last resort escape place for the most severe effect depression had on me:</p>
<p>The most extreme sensation i had and have sometimes still from depression is the sensation of feeling <strong>no emotions</strong>, none. Neither joy nor sadness nor anything. As in i just felt nothing, anything was equal, even though when i had visits from family or friends it did nothing with me which wasn’t easy for them either. Touching me physically during that time also became impossible for anyone, the social retraction and resulting social phobia got to a point getting a hug from a family member or friends was not possible.
I should also add that family was not the first to learn i had depression but rather friends, simply because i felt more comfortable sharing it with them, over family. But when they learned they tried to be supportive to the degree i was able to support, since for me a lot of stuff which you would call normal like talking or getting groceries or making appointments became basically impossible for me.</p>
<h2 id="how-did-you-get-help">How did you get help</h2>
<p>I probably won’t go into much detail here because it’s still “fresh” for me and also resolves a lot about suicide thoughts/attempts.</p>
<p>At a certain point it became obvious to me that even though friends and family where very supportive, that it was not going to last much longer without professional help, the suicide thoughts where too present at that point and also otherwise it wasn’t like there was much of my prior self left i guess?</p>
<p>So on a Wednesday midday i wen’t into the ER of a big hospital here in Berlin with a friend who was in Berlin then by accident(I’m not sure i would have made it alone). I didn’t have to wait very long because of a big cut on my forearm which apparently needed stitching, but after that it was a waiting game for most parts of the day. I then talked to a psychiatrist, i should mention that keeping eye contact was not possible for me, just merely trying to answer the questions he had took a big part of my energy. After evaluation he also shared the view that it was very urgent for me to get professional help and also asked me to stay at the hospital, even though not that hospital, because it turns out i had to move to a different hospital which is responsible for the district i’m living at. So after waiting a bunch more and getting there(by a kind of ambulance but not really) and waiting a good while longer, getting blood taken and a EKG written in the meanwhile, i spoke to a psychiatrist there(it was 11pm by then). He also asked me to stay but i said i can only do that if you have single bed rooms, which again i had a bad social phobia back then.
So after some discussion back and forth he brought up “Tagesklinik” which translates to “Day Clinic” which is a part of a hospital for people for mental health issues where you basically stay from morning through the afternoon but then sleep at home, looking back at it now it would probably have been better to stay at the hospital because from the day i was in the ER to the day i was taken by the day clinic, <strong>two weeks passed</strong> and it only worked because of help from my friends and family through other friends pushing the urgency.</p>
<p>I should maybe reiterate that i don’t think i would have lived much longer without that step, depression and resulting suicide thoughts is a very dangerous cycle and you might realize to late, i only did realize just in the right time because i had the luck of having contact with friends(even if not irl) who pushed me to do that step and went with me the entire way of it and everything after.</p>
<h3 id="day-clinic">Day Clinic</h3>
<p>It’s the place which saved me i suppose? (alongside some amazing friends, even if remote).
I stayed there for 6 weeks in total, most of the activities you do are in a group and obviously resolve around depression and depression related stuff but there’s also stuff like dance therapy, music and so on. On top of course 1:1 sessions with therapists.</p>
<p>The Fact it was group based made it very very very difficult at first for me because of the social phobia but it was also the best ground for improving that, especially since you are around people who have similar experiences and <strong>don’t judge you</strong> or wonder, most of them have been there(even if maybe not such an extreme social phobia).
The Social phobia, suicide thoughts, self harm events and most importantly feeling emotions slowly came back over the 6 weeks and I’ve received a lot of good feedback about the improvements there from friends.
Overall the things i learned there, the people i met, the structure it gave me had a huge impact on me in a positive way.</p>
<h2 id="learnings">Learnings</h2>
<p>The most important learning not only from the day clinic but the entire experience since it started is that I’ve learned a lot about myself and how i work emotionally, so even though it was a horrific experience it had as positive to understand more how i work, react and response emotionally and taught me a lot to deal with sensations and emotions, positive and negative.</p>
<h3 id="positive">Positive</h3>
<p>I think the most important positive lesson i took from this experience is that <em>it can get better</em> and there are people who genuinely care about you even though it might seem unreal in a bad depression.
Further that depression is something even if dangerous can be dealt with and improved.
do not be judged over it by family or friends(even if a lot couldn’t relate) non ever judged me over it.</p>
<h3 id="negative">Negative</h3>
<p>There are a few negatives but i don’t want to put them too much in the spotlight but to make it short: knowing such an episode can happen again, I’ve taken a few physical scars from that episode and lastly I’ve become very sensitive around the topic of depression or anything remotely related because it instantly puts me back in a faint shadow of the sensations i guess?</p>
<h2 id="antidepressiva">Antidepressiva</h2>
<p>I wan’t to quickly touch the subject here, i take an antidepressant called <a href="https://en.wikipedia.org/wiki/Sertraline">Sertraline</a> (zoloft), 100mg a day.
It has had a very positive effect, admittedly it had a few side effects at first(i was at 50mg/day then) like sleep issues, sweating, and some light trembling of the jaw, but these went away after a few weeks. The Sertraline was not the main reason the depression got so much better, that was people and the Day Clinic but it did gradually help by supporting a better mood, i should point out though that it was very gradual and not something which happened over night.</p>
<h2 id="relapse">Relapse</h2>
<p>This is the main reason i’m writing this because while the depression was entirely gone for 2-3 months after the day clinic it has been manifesting itself again since the Christmas time, a little before Christmas i also saw my local psychiatrist who advised to increase Sertraline to 100mg/day due to my worsening mood there already. It’s not close as bad as it was in August/September. But the chest pain, lack of emotions and so on has been manifesting itself a bit over the last few weeks.
<strong>But I’ve had this before and also have learned a lot how to deal with it and how to combat it so i’m confident its going to get better soon again, maybe a bit from Sertraline but mostly from experience and friends, having people knowing you have depressions and being there for you can make it so much easier</strong></p>
<p>That’s it for now…Thanks for reading</p>Liz3I’m not even sure where exactly to start here, who this is for or why exactly i’m writing it but supposedly it’s if you want to learn about the topic or hear my experiences with it, how it changed me and how i cope with relapse.Getting let go suddenly of a company i liked working at2023-11-28T00:00:00+01:002023-11-28T00:00:00+01:00https://blog.liz3.cat/getting-fired<p>In my last post i proudly said im working for <a href="https://bun.sh">Bun</a>, well that didn’t exactly last long.
To be clear i don’t want to accuse anyone of the bun team, its more just writing down my thoughts.</p>
<h2 id="what-happened">What happened</h2>
<p>Frankly i’m still processing that myself and if i had a definite answer i would give you it but i don’t have one so this is just thoughts.</p>
<p>On friday Jarred asked if we could chat, i answered a bit later but didn’t get a response, i tried again Saturday and Sunday,
but i only got a response on Monday evening(my time) short notice which i was fine with, buuut it was basically: We are terminating the contract effective immediately.</p>
<p>That caught me very off guard since i wasn’t expecting it at all and there was no prior communication that something was not up to expectation.</p>
<p>The abstract reason seamed to be that the communication and quality of the contributions was not meeting expectations.</p>
<h3 id="communications">Communications</h3>
<p>This is partly probably due to the reason that i’m remote and the bun team does not have a lot of experience working with remote people, which is fine.
I think when i started i was even asked if i would consider moving to the US but i have friends here in Germany and i have Diabetes typ 1 which means that
for me it would be pretty hard there considering the insulin price. So that was never really a option for me, at least not long term.</p>
<p>I should really point out that prior to starting at bun i didn’t have any real experience in the zig language, but that can be learned.
I did although create some bigger prs pretty early even before working for them, which is maybe something i should have reconsidered but at that time i thought
its a good approach to challenge myself and surely i would get good reviews pointing me into the right directions.</p>
<p>Well thats the big point, reviews: Getting reviews was very hard due to to the fact i often requested reviews but these requests got left unanswered,
where answered with little explanation but most importantly: <strong>no followup</strong>, there was almost never a follow up after me answering or asking a question on reviews, neither on github nor discord.
And for the most part i did write follow up questions asking what the correct or better approach would be, knowing that i didn’t have a lot of experience in zig.</p>
<p>One time i was even offered advice where to investigate a bug, but me asking about that was left unanswered.</p>
<p>Note that in no point was i ever informed that this is something i should know, which understandably is not something a team would just do but id rather have that
then being let go instantly, i mean afterall don’t we all have to learn at some point? Learning was the most important thing for me besides helping the project,
it seams that view was not really shared…at least in the aftermath now.</p>
<h3 id="quality-of-contributions">Quality of Contributions</h3>
<p>This is somewhat subjective but il try to keep it as objective as possible.</p>
<p>Knowing i was new to the codebase its likely contributions would initially have more mistakes and be more bug prone, thats unavoidable.
There also lies part of my fault maybe for trying bigger contributions early. But thats how you learn, and its not like there was ever broken code merged.
A example is this Pull request: <a href="https://github.com/oven-sh/bun/pull/6693">bun:6693</a> which i firstly implemented wrongly based on a flawed assumption, after a short
conversation that the code might be flawed and me arguing it seams to work we left the pr open with the explanation that this needs more tests, since this
included edits to a third party library maybe also running their test suite(Something another engineer had on their TODO).</p>
<p>Fast forward a few weeks the maintainer of the third party library wrote that the implementation is flawed, the next day after some comments i implemented the “correct”
approach and also added a lot of extra tests, note that in the weeks from opening that Pull Request and the new comments i also learned more of course and got more experiemce with the codebase.</p>
<p>Now you get to decide whether this is something worth getting let go over, i don’t know the answer but my subjective opinion is that knowing im <strong>learning</strong>,
and implemented the fix within a day and also addressed further reviews very fast it seams somewhat hard but again thats my subjective view.</p>
<h2 id="conclusion">Conclusion</h2>
<p>Im not entirely sure what the takeaway is here, because the mistakes i was let go over seam like something you should <strong>expect</strong> from someone new to the project and i made clear
very early that im new to zig too but willing to learn. Id argue im generally not someone who needs a <em>lot</em> of guidance.</p>
<p>But my only real critique is that i <strong>really really</strong> tried to get feedback and advice the entire way through. And im not referring to being spoon-fed the solution,
but just being pointed in the right direction. And maybe questions not ignored. Further maybe giving a <strong>single</strong> headsup that its not going as expected,
before ultimately just being let go instantly.</p>
<p>I like the bun project and the way it works and maybe i will continue open-source contributing to it if it works out, but the way i was let go was a punch in the face, since i did try to do it the right way but trying was not enough.</p>Liz3In my last post i proudly said im working for Bun, well that didn’t exactly last long. To be clear i don’t want to accuse anyone of the bun team, its more just writing down my thoughts.My issue with Next.js and other react based frameworks2023-11-14T00:00:00+01:002023-11-14T00:00:00+01:00https://blog.liz3.cat/nextjs<p>I’m aware this is a controversial topic, i don’t want to suggest that these frameworks are bad or unnecessary, but rather add my opinion to what i think over them</p>
<h2 id="how-this-started">How this started</h2>
<p>I’ve not done a lot with react lately, im more working with native languages, doing zig and c++ at <a href="https://bun.sh">bun</a>, but ive done a fair share of react development in my life at blitz, giggl and personally too.
But i’m coming from the <a href="https://create-react-app.dev">create react app</a> days, long before frameworks like next, remix and the likes where that popular.</p>
<p>Now if you where doing react in that time you remember react as being a soley client side operating library, as in the files which the server side “served” where purely static and didn’t need execution at all,
that had and has the advantage of being a lot less server load and traffic but has the disadvantage of being bad for SEO and also requires the client to run a relatively large javascript bundle before having a contentful paint(in a lot of cases at least).</p>
<h2 id="the-problem">The Problem</h2>
<p>I think the main question is whether do you need server side execution for SEO only or to actually serve prerendered content. Since if the client runs your application its less compute your server has to do, so maybe a tradeoff between server side rendered and client side rendered has to be done.</p>
<p>The problem is that react was designed as a client side framework, so running it server side was never actually the intention, that also becomes very evident when you watch the documentary Honeypot did on react, facebook at the time had to move more execution to the client.
And if you actually think about it it does seam more logical, transfering raw json data over a api is less traffic then serving rendered html and again it reduces the cost you have to pay on your server because more of the execution is spend on the client.
With most clients these days being so fast that arguing whether the tradeoff of having to wait a bit for a contentful paint becomes very real. It was back when react was created and id argue that our computers and phones did not become slower since then.</p>
<p>But a bigger issue is the way especially next.js tries to blur the lines between whats a feature of the facebook based react library and whats part of the apis provided by the framework like next.
It’s pretty obvious that the react team does promote these frameworks quite heavily, if you go to <a href="https://react.dev/learn/start-a-new-react-project">how to create a react project</a> you get the frameworks as the suggested option and if you wan’t to use react as a standalone library you get a big block of text explaining why you shouldn’t with a small note at the end giving you the two packages you need without any further explanation. CRA is entirely gone from the react documentation.</p>
<p>But my biggest issue by far that Next.js is by <a href="https://vercel.com/">Vercel</a> which is a serverless cloud provider which is for-profit so they have a massive commercial interest in promoting more server side heavy architectures since they directly profit from that, which also gives it a reasonable explanation why they are actively trying to blur the lines between whats react and whats next js and make it more difficult to deploy next outside of vercel then on vercel, its possible to deploy outside of vercel but a lot less convenient.</p>
<p>I also distinctly remember at blitz.gg that their site was hosted on vercel(called zeit back then) for a good while and switched off it again because the server cost was so absurdly high, the app had very limited SSR back then.</p>
<h2 id="whats-a-solution">Whats a solution?</h2>
<p>I don’t think thats very easy to answer, i don’t mind vercel promoting next as easy to deploy on their platform, them making money of vercel also means that they can re invest it into next development making better developer tools while paying the bills of people doing it.</p>
<p>But i do mind them trying to blur the lines between next and react. I think a clearer seperation and especially re-adding documentation for client side only react, simpler projects only with the react library and making clear that is an option, since it is possible to use react standalone with build tools(like esbuild etc) and also create react app is still a thing even though it is maybe a bit out of date.</p>Liz3I’m aware this is a controversial topic, i don’t want to suggest that these frameworks are bad or unnecessary, but rather add my opinion to what i think over themAbout loosing a discord account, getting it back and the Discord support2022-03-10T00:00:00+01:002022-03-10T00:00:00+01:00https://blog.liz3.cat/discord-account<p>Hah, i would never lose my discord account, how could this ever happen to anyone EVER whos not actively trying to,
believe me i thought that too, i was sure i wouldnt ever get my account stolen,
but i still did, so let me tell you a story, with some key takeaways along the way, even for experienced users.</p>
<h2 id="how-it-started">How it started</h2>
<p>Date: 13th January 2022</p>
<p>I am Administrator on a larger Discord server, > 100.000 users, i wont be mentioning the name here,
not because i want to hide it, but rather because its not important for this story.</p>
<p>A day before this happened, another admin on that server stepped down from their permissions,
they did not remove the roles doing hoisting or sorting but the roles actively giving permissions where removed from that user.</p>
<p>I have Administrator on that Server…
That night, the account of that Admin contacted me, note that i was aware of them being a admin, but i was not aware they stepped down, neither did we ever message before.</p>
<p>This is important as it meant i was not aware of how the person normally behaves in direct messages,
after a certain while of writing with a person you learn how they behave, their writing style, quirks and the likes.
Notheless since they where a Admin, they had a certain trust level already from me, a strange account would not have from me by default.</p>
<p>So during their initial messages, i was watching youtube, i was not on alert, their initial contact was,
(i will be using Person rather then their real name, from here and for the rest of the story):</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Person > Liz
Me > Hey
Person > Can you help me?
Me > depends
Person > i am *persons name*
</code></pre></div></div>
<p>The person then proceeded to send a link to the big server, along with a screenshot of their roles on that Server.</p>
<p><strong>Takeaway: A real person is not likely to mention its them in a direct message channel.</strong></p>
<p>I can only mention again i never wrote with that person before,
but here i did the first f-up, i did not get suspicious when they introduced themselfs, which normally shouldnt happen.</p>
<p>i then answered:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Me > ik
Me > it still depends
</code></pre></div></div>
<p>i actively ignored that warning signal.</p>
<h2 id="what-the-scam-was">What the scam was</h2>
<p>This was a targeted phishing attack towards people with high roles,
this was and is my main discord account which i have since 2016, it has dms with over 50.000 messages:</p>
<p>The person then proceeded to pretend the following:</p>
<p><em>They where applying as a Discord verified moderator and i would need to vote for them,
along with a link which was not discord.com, but neither was a obvious typo of discord.com, it was a extra word,
which without context could have been valid.</em></p>
<p>For context here: Discord does have a certified Moderator program, but it does not have a vote system(i was not certain about that at that date),
so before i did click the link i googled it, sadly google did not have that site as first result,
but a discord blog article which after checking it was close enough to me with the trust not instantly marking this as a red flag obvious scam, but the article also didnt link a external site anywhere.</p>
<p>So i clicked the link and it brough me to a discord login page, i was not sure here, i had a bad feeling about it being legitimate,
i went back to the discord chat and saw they <em>deleted the message with the link</em>!</p>
<p><strong>Takeaway: If a person deletes a link in a chat they want you to do something, thats a clear red flag!</strong></p>
<p><strong>Takeaway: if a domain isnt high up on googles result, do not trust it!</strong></p>
<p>i then wrote:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Me > did you delete the link?
Person > i accidentally deleted
Person > did you get to vote for me?
</code></pre></div></div>
<p><strong>Takeaway: Them pressuring you to do something should make you very suspicious</strong></p>
<p>I then refreshed the page to check if the QR code refreshed, it did.</p>
<p>So i tried to login with a QR code, but that did not work, it failed with the following message on my phone:
<img src="/assets/images/discord/scam_qr_error.png" style="height: 400px; width: auto" /></p>
<p><strong>Takeaway: Discord has these systems centralized, if this fails its, 10000% a scam</strong></p>
<p>But i didnt think that in that moment, i thought that discord was just having issues with it…
So i manually logged into the site, together with 2FA.</p>
<p><strong>Takeaway: 2FA is not a protection against phishing!</strong></p>
<p>After logging in into the site, i was instantly redirected to that login site and there i realised it….</p>
<p>Within the 30 seconds time frame of the 2FA code, the scam automatically replaced the 2fa token AND the backup codes, it was not possible to login with the backup codes, yes i actually save them,
this was probably one of my darkest moments ever.</p>
<p>The main issue here again was that i had that initial trust towards a person, i had no direct contact with before but knew as a admin from a big server.</p>
<h2 id="whats-next">Whats Next?</h2>
<p>Wow what a shock, i just lost my discord account to a scam….it really happened to me.
After about 5 minutes of trying, i gave up on getting back into it, i would not.</p>
<p>The first thing i did then was messaging the owners/important persons outside of discord, i.e whatsapp, iMessage and so on to remove my account from servers,
remember this was a targeted attack, not a mass thing, further i asked to be removed from the bot teams i was on, well get to this later.</p>
<p><strong>Takeway: message server owners of servers your account could do damage to instantly, to minimize impact as far as possible, further message your friends, make people aware your account was compromised as much as you can to protect them!</strong></p>
<h2 id="the-server-incident">The Server incident</h2>
<p>The server of which the scammers got the account from which they messaged me, did not have people online who would have been able to remove my roles or kick my account,
there happened so much on that server, this would deserve its own blog entry to be honest, but in short, i tried to kick my account using bots, waiting for people but in the end non worked and yes,
here the worst of the worst happened, the entire server got destroyed because my account was compromised, remember the other account had no actual permissions left…</p>
<p><strong>Takeaways:</strong></p>
<ul>
<li><strong>Stand to your mistake, like i did, to this day i fully stand to what happened there, its my and only my responsbility.</strong></li>
<li><strong>True friends will not leave you or be mad at you, even after this, funny this is a test to see directly if the people who entrusted you are real friends or people only using you against payment of roles</strong></li>
</ul>
<p>Having to witness the server being destroyed was probably one of, if not the worst feeling i ever had.</p>
<p>Since then the server learned a lot, im still admin there, although i learned a lot too.</p>
<p>Even though the first reaction of a server owner would probably be to not trust people anymore with permissions,
i deeply think thats the wrong approach, why?</p>
<p>You need people you as a owner can trust and this happening will always be a risk, just try to minimize it as much as you can, not entrusting people with permissions is one way but it comes at a big price of extra work and possible distrust…</p>
<h2 id="getting-my-account-back-or-discord-support-choose-the-one-you-like">Getting my account back OR Discord support, choose the one you like</h2>
<p>This section will cover two incidents, one was getting the account, the other lasts to this day,
further i want to open how TERRIBLE and BROKEN the discord support is, told from my experiences.</p>
<h3 id="getting-the-account-back">Getting the account back</h3>
<p>I would not have gotten my account back through the normal support.</p>
<p>So rapidly after loosing the account, messaging the people of work and other servers,
i opened a support ticket with the normal support, both from my original email the account was under and the email of my alt.
Discord uses Zendesk, you can answer tickets in two way, the one is through the website although you need to login here, the other is through answering emails send to the address associated with the ticket.</p>
<p>Since i lost the account, that in returns means i would only be able to answer per email to the ticket opened from the original email the account was under.</p>
<p>Discord even required you to answer per email in order to confirm the ticket regarding a compromised account,
WELL JOKES ON YOU!!!</p>
<p>I use mailbox.org, a very very good german email provider which takes the work of hosting a email server from you, against a small price you can use custom domains and have a very reliable email service,
i never had problems with them before.</p>
<p>But my emails answering the ticket, where always <strong>rejected</strong>, not on a mail server layer, but by a zendesk filter, it does not matter if i used links or not, it simply did not work, here the answer:
<img src="/assets/images/discord/email.png" alt="Discord email rejection" /></p>
<p>Im pretty sure in total i tried to answer 25 times to tickets without a single success.</p>
<p>Because the next day, with the help of a friend, the original ticket was answered and they reset the account to my original email,
with the site effect of the account being active again resulting from that(the account was disabled luckily later the morning it got compromised).</p>
<p>But they didnt reset the 2FA! so i was unable to reset the password because the 2fa was still set to the scammers one, since the account was active again that meant the scammer /could/ theoretically login again,
again due to the 2FA of the scammers being still active on the account.</p>
<p>And i was unable to answer emails and let them know….</p>
<p>so i was in the air,
the request from my alt, the account i used while i did not have my original, clearly mentioned in the ticket that:</p>
<blockquote>
<p>This is the seccond request i do but i cannot answer the email to the first because it gets rejected by zendesk.</p>
</blockquote>
<p>But still got a copy paste answer stating:</p>
<blockquote>
<p>Hey Yann,<br />
To protect our users’ privacy and security, we’re only able to discuss account details with the email address associated with that Discord account. Since it looks like you’re currently writing in about another account associated with another email address, please send us a new ticket through that other email address via our support form instead and I can help check on that request through there.<br />
For General Support - https://dis.gd/contact<br />
If you have any other questions in the meantime, please let me know here!</p>
</blockquote>
<p>i.e the support did not even READ my request, i totally get those protective measures and they make sense, but the support should at least read and try to provide a way to work around the issue, we will get back to something similar in the next section.</p>
<p>In the end i got the account back the next morning through a friend who had directly contacted a employee at discord, who manually reset the 2fa code and all spam flags on the account, giving me it back, thank you.
To this day i stand by the statement, i would not have gotten the account back through the normal support, because of the email issue. which shows a fatal flaw in their system.</p>
<p><strong>Takeaway: The discord support might not be able to help you, if you loose your account!</strong></p>
<p>After this happened, i made a suggestion, that:</p>
<p>Discord should allow accounts who got important credentials like the email changed and which also have higher roles in big servers, allow the original entity, i.e the old email address to <strong>suspend</strong> the account through a link in a timeframe of maybe 12 hours,
freezing the account until manual verification is done, this would have prevented the destruction of the server which was destroyed by my account being compromised.</p>
<p>In total i lost the account for about 30 hours, maybe +- 2 hours.</p>
<h3 id="the-early-verified-developer-badge-story">The Early verified Developer Badge story</h3>
<p>This is pretty insane and goes to this day!</p>
<p>I worked at Animesoul for a long time, making anime.pics, working on their main site and also the bot Shoob, which i had written major parts in.
That bot also got verified before discord discontinued the badge, so i had that badge,
<strong>and of course badges are cool, i would be lying to say i dont like them</strong>.</p>
<p>When this happened i messaged the original admin to remove me from the team the bot was on in order to <strong>Protect the bot</strong>:
<img src="/assets/images/discord/wa1.png" alt="whatsapp1" /></p>
<p>Sadly doing that, also had as a side effect that i lost the badge, in the conversation we even quickly talked about the badge:
<img src="/assets/images/discord/wa2.png" alt="whatsapp2" /></p>
<p>Now lets forward a while,
two days after i got my account back, the Admin of the bot readded me to the team, where i was hoping to get the badge back, but i didnt, so i opened a support ticket in order to attempt to regain it,
one could argue that i lost it because of own dumbness and thats not even wrong, But i lost it in the process of protecting the bot, not as a direct effect of the compromise.</p>
<p>Here the message i wrote to the support:</p>
<blockquote>
<p>Hey there,<br />
this means a lot to me so i would be happy to get a short attention from whoever reads this on the supporting end.<br />
I lost this account a couple days ago to a scammer for a time period of about 26 hours.</p>
</blockquote>
<blockquote>
<p>My account had the Early verified bot developer badge for the bot Shoob, bot id: 673362753489993749.<br />
I lost my Early verified bot developer badge during the time period the scammer had the account, although not because he did something, but because i asked the admin of the discord developer team to remove me in order to protect the bot.<br />
After i got the account back, the admin of shoobs team already added me back to the team but sadly it seams that does not reinstate the badge :((((…i would lie to say the badge didnt make me proud and i would love to have it back although i will accept all outcomes, my id: 195906408561115137.</p>
</blockquote>
<blockquote>
<p>I love discord and it would mean the world to me if it was possible to get it back.</p>
</blockquote>
<blockquote>
<p>here the data again<br />
Bot id: 673362753489993749<br />
My account(this) id: 195906408561115137<br />
The Developer teams id(i am a part of it again): TEAM ID<br />
I added a screenshot of a old chat with the animesoul owner where we got the badges…<br />
Kind regards,<br />
Liz3</p>
</blockquote>
<p>I quickly got a answer, note that for the account restoration it took almost 16 hours, this answer came within 15 minutes:</p>
<blockquote>
<p>Hey Liz3,</p>
</blockquote>
<blockquote>
<p>Thanks for reaching out to us!</p>
</blockquote>
<blockquote>
<p>As we recently announced in our official Discord Developers server, we discontinued the verified developer profile badge for anyone who submitted their bot for verification after August 19th, 2020. Any bot which requested verification prior to that date and is approved for verification will still receive the profile badge, now renamed the Early Verified Developer badge.</p>
</blockquote>
<blockquote>
<p>When we announced the Bot Verification process, we promised that it wouldn’t be a long and difficult process. We wanted to maintain a five-day turnaround time, and we haven’t done that. We’re taking the following step to try and better meet that commitment.</p>
</blockquote>
<blockquote>
<p>We’ve approved thousands of bots so far. As time goes on, the verification queue has become more and more filled with fraudulent submissions by individuals that are not submitting actual bots, but are going to extreme lengths to get a profile badge. These submissions are hindering the ability for legitimate bots to get verified in time for the deadline.</p>
</blockquote>
<blockquote>
<p>All verified bots will continue to receive the Verified checkmark. The checkmark for your bot is an important way for our community to recognize your bot as a trusted bot partner. The only thing we’ve discontinued is the special badge on a developer’s profile.</p>
</blockquote>
<blockquote>
<p>I sincerely apologize for any confusion or disappointment this causes. If you have any further questions regarding this change or anything else, I’d be happy to help further, and please consider joining our Developers server as well for further announcements regarding the Discord API and our bot verification program.</p>
</blockquote>
<blockquote>
<p>Sincerely,<br />
Support person</p>
</blockquote>
<p>I cannot express how incredibly disgusting the answer is, i was really thinking to include the persons name, but i have enough respect not to,
but this answer shows the support person did NO EFFORT to even READ my request and just went on with a simple copy paste answer…which is extremely disrespectful, considering i spent time detailing the case.</p>
<p>Do i not even deserve a human answer?
I then annoyed answered them with:</p>
<blockquote>
<p>did you read my question? i had it.<br />
the bot is verified and i had the badge.</p>
</blockquote>
<blockquote>
<p>Why does the support seam to just paste answers copy paste, i spent time detailing my case and get hit like that. Please read my case and give he a human answer if possible.</p>
</blockquote>
<blockquote>
<p>Liz3</p>
</blockquote>
<p>and importantly:</p>
<blockquote>
<p>Any bot which requested verification prior to that date and is approved for verification will still receive the profile badge, now renamed the Early Verified Developer badge<br />
This applies here</p>
</blockquote>
<p>They then just answered with, no sorry cant do anything…</p>
<p>wow, not a single interest in providing help, not only in the regards that the <strong>important request</strong> to lock or restore the account took almost a day and this was answered in 15 minutes, but also that they really do no effort in helping.</p>
<p><strong>But it gets even better!</strong></p>
<p>Out of frustration i opened a new ticket, with a very similar content to the original above,
to which i got this answer</p>
<blockquote>
<p>Hey Yann,</p>
</blockquote>
<blockquote>
<p>Thanks so much for gathering all of that info for me! I just wanted to let you know that I’ll be escalating this ticket to our dev team to look into further. I genuinely apologize for the inconvenience in the meantime and will keep you updated here as soon as I hear back!<br />
Let me know if you have any other questions at any time!</p>
</blockquote>
<blockquote>
<p>Best,<br />
Another support person</p>
</blockquote>
<p>That sounded so good, i answered thanking and that i would wait patiently,
wait, wait, <em>wait to this day</em></p>
<p>Yes to this day they did not answer that ticket, i still want a answer as i think i made a good argument,
in the mean while discord removed the sign in on their support site, so all these texts are from the received emails….</p>
<p>Thats it!</p>Liz3Hah, i would never lose my discord account, how could this ever happen to anyone EVER whos not actively trying to, believe me i thought that too, i was sure i wouldnt ever get my account stolen, but i still did, so let me tell you a story, with some key takeaways along the way, even for experienced users. How it started Date: 13th January 2022 I am Administrator on a larger Discord server, > 100.000 users, i wont be mentioning the name here, not because i want to hide it, but rather because its not important for this story. A day before this happened, another admin on that server stepped down from their permissions, they did not remove the roles doing hoisting or sorting but the roles actively giving permissions where removed from that user. I have Administrator on that Server… That night, the account of that Admin contacted me, note that i was aware of them being a admin, but i was not aware they stepped down, neither did we ever message before. This is important as it meant i was not aware of how the person normally behaves in direct messages, after a certain while of writing with a person you learn how they behave, their writing style, quirks and the likes. Notheless since they where a Admin, they had a certain trust level already from me, a strange account would not have from me by default. So during their initial messages, i was watching youtube, i was not on alert, their initial contact was, (i will be using Person rather then their real name, from here and for the rest of the story): Person > Liz Me > Hey Person > Can you help me? Me > depends Person > i am *persons name* The person then proceeded to send a link to the big server, along with a screenshot of their roles on that Server. Takeaway: A real person is not likely to mention its them in a direct message channel. I can only mention again i never wrote with that person before, but here i did the first f-up, i did not get suspicious when they introduced themselfs, which normally shouldnt happen. i then answered: Me > ik Me > it still depends i actively ignored that warning signal. What the scam was This was a targeted phishing attack towards people with high roles, this was and is my main discord account which i have since 2016, it has dms with over 50.000 messages: The person then proceeded to pretend the following: They where applying as a Discord verified moderator and i would need to vote for them, along with a link which was not discord.com, but neither was a obvious typo of discord.com, it was a extra word, which without context could have been valid. For context here: Discord does have a certified Moderator program, but it does not have a vote system(i was not certain about that at that date), so before i did click the link i googled it, sadly google did not have that site as first result, but a discord blog article which after checking it was close enough to me with the trust not instantly marking this as a red flag obvious scam, but the article also didnt link a external site anywhere. So i clicked the link and it brough me to a discord login page, i was not sure here, i had a bad feeling about it being legitimate, i went back to the discord chat and saw they deleted the message with the link! Takeaway: If a person deletes a link in a chat they want you to do something, thats a clear red flag!My Image galleries2022-01-22T00:00:00+01:002022-01-22T00:00:00+01:00https://blog.liz3.cat/photography<p>Those who know me a bit longer are aware i did a lot of amateur photography when i was 17-19, im picking that up again!</p>
<h2 id="galleries">Galleries</h2>
<p>List of the Collections i did.</p>
<h3 id="first-night-doing-some-shots-with-the-fujifilm-x100v">First night doing some shots with the Fujifilm X100V</h3>
<p><a href="https://blog.liz3.cat/galleries/01/">galleries/01/</a></p>
<h3 id="shooting-berlin-street-and-architecture-with-nikon-d75024-70-f28-and-fufifilm-x100v">Shooting Berlin street and architecture with Nikon D750(24-70 f/2.8) and Fufifilm X100V</h3>
<p><a href="https://blog.liz3.cat/galleries/02/">galleries/02/</a></p>
<h3 id="a-cool-day-photographing-ducks-and-swans-with-the-nikon-d75070-200-f28">A cool day photographing Ducks and Swans with the Nikon D750(70-200 F/2.8)</h3>
<p><a href="https://blog.liz3.cat/galleries/04/">galleries/04/</a></p>Liz3Those who know me a bit longer are aware i did a lot of amateur photography when i was 17-19, im picking that up again!Iracing And Devs2021-12-18T00:00:00+01:002021-12-18T00:00:00+01:00https://blog.liz3.cat/iracing-and-devs<p>So you do windows kernel development but then one day decide you want to play iRacing? Heres my story:</p>
<h2 id="the-problem">The Problem</h2>
<p>I like motorsport, its not a secret, on that day i wanted to play some iRacing to see the Mercedes Benz AMG W12 which was developed for the iRacing simulator.
But surprise i also develop! And while i do not mainly work on windows, i have a ssd in my tower running windows for some games or when i test/develop windows specific things…and it happens that around 4-5 months ago i did some kernel development/testing regarding Genshin impact reverse work.</p>
<p>iRacing installed correctly, everything fine. But when i then tried to launch the test track, <strong>It got stuck at “Loading Sim: 0%”</strong>…</p>
<p>Mh i wondered, what could that be, did the install fail? did i need to restart?(iRacing comes with EasyAntiCheat, which i can understand since its a competitive simulator)
So i re reinstalled everything, but still, nothing….so i did some digging where iRacings logs are and after i found them i saw: “Cannot launch Easy anti Cheat with Forced driver signing disabled”.</p>
<p>Oh okay….</p>
<h2 id="the-solution">The solution.</h2>
<p>Since i did the kernel testing i had test mode enabled….<em>The sim could have warned me but whatever, just lost 30 minutes trying to search for the reason</em>.</p>
<p>So the fix in the end was rather simple but i wanted to write it down incase this might help someone.
Run a CMD as Admin and use</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>bcdedit /set TESTSIGNING off
</code></pre></div></div>
<p>Then you will need to restart but that should let iRacing be happy and start normally…</p>Liz3So you do windows kernel development but then one day decide you want to play iRacing? Heres my story:Weed experienced the other way…2021-12-13T00:00:00+01:002021-12-13T00:00:00+01:00https://blog.liz3.cat/weed-the-other-way<p><em>note the times are in european standard but 12-23 is pm, 0-8 is am</em></p>
<p>Where do i start on this one, well at the beginning i suppose.
I am generally open towards drugs, not extreme since i am very aware of the dangers but i also see the benifits and thus i am rather open towards them.</p>
<h2 id="the-beginning">The beginning.</h2>
<p>I will try to hold this short, basically this friday evening i planned to do <strong>hash brownies</strong> with two of my friends… i will not disclose their names for privacy reasons since this is about me.
But all of us are adults and non of us is imature or silly in their actions, normally</p>
<p>I have had some experiences with smoking weed but nothing intense, <strong>im not a active smoker</strong>, this was my first time doing hash brownies.</p>
<p>So we started the evening(19:00), when i arrived the brownies where not done and thus we had some good talks and <em>ordered pizza, so we had eaten enough</em>.</p>
<p>Again this was my first time so i didnt know exactly what to expect but i was aware brownies act slower but more intense and longer then smoking it.</p>
<p>Around 21:30(might have been from 21:00 i cannot remember exactly) the brownies where done and i ate one, we continued to watch stuff, feeling nothing yet.</p>
<h2 id="the-waiting">The Waiting</h2>
<p>The first brownie was already a while ago….nothing yet, it was 22:15 now, so we talked for a while and then decided to eat a <strong>second hash brownie</strong>…this was probably the dumbest decision i made in a long time.
We then continued watching star wars the clone wars…</p>
<h2 id="the-relaxed-phase">The relaxed phase.</h2>
<p>Id say around 23:00 i started feeling something which wasnt extreme but it was a sense of having to concentrate more then usually to what happened in the episodes.<br />
10 minutes later i got a wave of heaviness/foginess rolling my body up and into my head…i knew now it was starting to take effect.</p>
<h2 id="whats-this">Whats this?</h2>
<p>My friends started feeling something around the same time id say but the action started at 23:30 when my friend started feeling somewhat overwhelmed by the high of what i think was the first brownie kicking in.</p>
<p>I started feeling a lot too but i was fine, i was aware and it was enjoyable actually, besides the fact of a very very dry mouth making chewing very hard and the fact time seams to slow down a lot.
we went into the garden and got some fresh air, i was high at that point but still fine…</p>
<p>When we went upstairs thats when it started to get bad for me.</p>
<h2 id="my-adventure">My Adventure</h2>
<p>It started that thinking clear was becoming harder and harder, i was very high at that point but still felt it was managable, we went down again for a while into the garden, there in one instance my friend was breathing out into the cold night and i believed he was throwing cartoonish flames into the air.</p>
<p>After we got up again it got really bad because i wasnt really oriented anymore. I forgot things i did 2 minutes ago, they have a cat i think when wanted to pat the cat and then suddenly was sitting in a chair again, there was another instance of me wondering where my phone is, with one of my friends then pointing out to me it was right next to me on the table.</p>
<p>Now the bad stuff begins…i always <em>tend</em> to have a faster heart when excited but im used to that and i can control it with breathing and slow it and all good…<br />
After the orientation started getting worse, i started feeling my heart more and more.</p>
<p>And that wasnt playing, i was setting doing nothing but trying to relax myself with a every increasing heart rate. At that point i was aware and trying to slow it with controlled breathing but nothing it just wouldnt decrease.<br />
As a side note, a little earlier there was already police there out of another reason and one of my friend asked them and got told to just wait the high out unless theres a critical health issue….well..</p>
<p>So after 5-10 minutes, <strong>it was 0:30 now i told my friend to call an ambulance</strong> since he confirmed too my heart was going fast and at this point i was just panicking while trying to be calm, as a funfact while he was on the phone i almost changed my mind and was about to tell him to leave it when it started getting extreme so i thought its probs the right thing to do.</p>
<p>So after he called them we decided to go down, they actually took a bit longer but i was already out, i was not feeling well and just trying to wait for the ambulance…and it was a long wait…or it felt like it, since in reality it was just what, 7 minutes?
I stod there infront of street, trying to understand where i was, what was going on. was the ambulance there and i was just at the wrong exit? where they not coming? i just stod there waiting….luckily they did come.
Still very stressed and as a result decided to sit down on the street floor.</p>
<p>And then yes shortly after the ambulance did arrive.</p>
<p>I was still able to walk and think luckily, after i went into the car. The medic put a small clip on my finger which does heart rate and such, after seing it from the clip that the heart rate was high, he asked me to lay down and they started putting the pads on my chest and (shoulders?) for more exact measurings.</p>
<p>Then they also took blood pressure and from there it was clear i was going to the hospital.
The medic asked me stuff while i was being driven, things like address and such and rightfully critised the consume of weed i had done but also saw that my current situation wasnt enjoyable.</p>
<p>As we arrived at the hospital, i was so high tihnking was hard and i didnt stand up either. i remember i had forgotten if i was in the ambulance with the back against or facing driving directions.
In the hospital things went their way, blood taked, and prepared for observation after i had switched beds, not walking.</p>
<p>The doctor who was consise but nice did a good analysis and then just put me on watch…</p>
<p>From there nothing extremely exciting happened except that the heart rate did not decrease, by 2 am it was still around 145bpm, which is why the doctor gave me medication which both times reduced the heart rate by about 15-20 bpm.</p>
<p>I spent the night there and around 5:00 got some sleep, when i woke up at 6:30 my heart rate was at 95 which is still fast but acceptable…at 8 i left the hospital…</p>
<h2 id="final-thoughts">Final thoughts</h2>
<p>Some notes, first to recap heres the heart rate in time from what i know since thats the reason i was brought to the hospital:</p>
<table>
<thead>
<tr>
<th>Time</th>
<th>Blood Presure</th>
<th>Heart Rate(BPM)</th>
</tr>
</thead>
<tbody>
<tr>
<td>0:51</td>
<td>158/80</td>
<td>144</td>
</tr>
<tr>
<td>1:07</td>
<td>152/77</td>
<td>142</td>
</tr>
<tr>
<td>4:09</td>
<td>116/70</td>
<td>116</td>
</tr>
</tbody>
</table>
<p>Again Note that it was consistently above 130 until 3am which is where i got the medication…
Even though in the aftermath i would have survived without the ambulance it was still the right thing to do.</p>
<p><em>But most of all value the health care people, the fact they acted so fast on whats basically a drug overdose and the work they do day in and day out is incredible and i pull my hat and thank every doctor, nurse and paramedic for the incredible work they do, its really a amazing job.</em>
<em>Thank you</em></p>Liz3note the times are in european standard but 12-23 is pm, 0-8 is amHow to debug Docker CLI api calls2021-11-24T00:00:00+01:002021-11-24T00:00:00+01:00https://blog.liz3.cat/docker-api-debug<p>So at <a href="https://giggl.app">Giggl</a> we do quite some stuff with Docker and i wanted to do some more specific things with the <a href="https://docs.docker.com/engine/api/v1.41/">Docker Engine API</a>.</p>
<h2 id="the-problem">The Problem</h2>
<p>The Problem is that the CLI arguments passed to the <code class="language-plaintext highlighter-rouge">docker</code> tool are not 1:1 the same passed to the daemon api, and for things like the <em>seccomp</em> you actually read files before sending the content to the Docker daemon.</p>
<p>It would be good if i could see what the <code class="language-plaintext highlighter-rouge">docker</code> tool sends to the API, because while the Engine Api has a documentation, it is missing certain things or does not dive into detail to the degree i would need….well turns out i can do that using a little hack!</p>
<h2 id="the-solution">The Solution</h2>
<p>I have this tool called <a href="https://github.com/liz3/dbg-server">dbg-server</a> which is a very simple http server to debug clients, its made to be spawned in a terminal or be piped but basically it prints what it receives to the console, note that it will accept any method and path, it will show us which path the request was.</p>
<p>So first we need to start the tool, if you have node/npm thats easy using the npx utility provided with npm:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>npx dbg-server <span class="nt">-p</span> 2020
</code></pre></div></div>
<p>Now we need a way to tell the docker tool to send to that server, basically we will make it think thats the docker daemon. since the returned response is empty, sometimes the docker tool might complain but we do not care since it send the request, though note that <em>dbg-server</em> can be passed the <code class="language-plaintext highlighter-rouge">-b</code> option followed by a string to return to the requester.</p>
<p>To tell docker to send its request to our client, we can use a ENV var it will check for, since this is a http server we need to use <code class="language-plaintext highlighter-rouge">tcp://</code> as the protocol, since we do not want to persist this change just execute it in a terminal window and we will have it for this session:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">export </span><span class="nv">DOCKER_HOST</span><span class="o">=</span><span class="s2">"tcp://0.0.0.0:2020"</span>
</code></pre></div></div>
<p>And thats it!</p>
<p>Now in the terminal window/tab where we executed the <code class="language-plaintext highlighter-rouge">export</code> command we can use any docker command, lets try <code class="language-plaintext highlighter-rouge">docker ps</code>:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">></span> docker ps
EOF
<span class="o">></span>
</code></pre></div></div>
<p>mmhhh that didn’t return any data, but we expect that, lets check the console where the dbg-server is running</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">></span> npx dbg-server <span class="nt">-p</span> 2020
server ready on 2020
HEAD <span class="o">=></span> /_ping[undefined]:
HEAD <span class="o">=></span> /_ping[undefined]:
HEAD <span class="o">=></span> /_ping[undefined]:
GET <span class="o">=></span> /v1.24/containers/json[undefined]:
</code></pre></div></div>
<p>LOOK AT THAT, we can see the client tried to <code class="language-plaintext highlighter-rouge">GET /v1.24/containers/json</code>!</p>
<p>Lets try to run a container with a volume:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="o">></span> docker run <span class="nt">-v</span> <span class="s2">"/Users/liz3:/root"</span> <span class="nt">-ti</span> ubuntu:latest
docker: EOF.
See <span class="s1">'docker run --help'</span><span class="nb">.</span>
</code></pre></div></div>
<p>Again <code class="language-plaintext highlighter-rouge">EOF</code>, again lets check the server:</p>
<div class="language-sh highlighter-rouge"><div class="highlight"><pre class="highlight"><code>POST <span class="o">=></span> /v1.24/containers/create[application/json]:
<span class="o">{</span>
<span class="s2">"Hostname"</span>: <span class="s2">""</span>,
<span class="s2">"Domainname"</span>: <span class="s2">""</span>,
<span class="s2">"User"</span>: <span class="s2">""</span>,
...
<span class="s2">"Image"</span>: <span class="s2">"ubuntu:latest"</span>,
<span class="s2">"Labels"</span>: <span class="o">{}</span>,
<span class="s2">"HostConfig"</span>: <span class="o">{</span>
<span class="s2">"Binds"</span>: <span class="o">[</span>
<span class="s2">"/Users/liz3:/root"</span>
<span class="o">]</span>,
<span class="s2">"ContainerIDFile"</span>: <span class="s2">""</span>,
<span class="s2">"LogConfig"</span>: <span class="o">{</span>
<span class="s2">"Type"</span>: <span class="s2">""</span>,
<span class="s2">"Config"</span>: <span class="o">{}</span>
<span class="o">}</span>,
<span class="s2">"NetworkMode"</span>: <span class="s2">"default"</span>,
<span class="s2">"PortBindings"</span>: <span class="o">{}</span>,
<span class="s2">"RestartPolicy"</span>: <span class="o">{</span>
<span class="s2">"Name"</span>: <span class="s2">"no"</span>,
<span class="s2">"MaximumRetryCount"</span>: 0
<span class="o">}</span>,
<span class="s2">"AutoRemove"</span>: <span class="nb">false</span>,
...
<span class="s2">"ConsoleSize"</span>: <span class="o">[</span>
0,
0
<span class="o">]</span>,
<span class="s2">"Isolation"</span>: <span class="s2">""</span>,
<span class="s2">"CpuShares"</span>: 0,
<span class="s2">"Memory"</span>: 0,
<span class="s2">"NanoCpus"</span>: 0,
<span class="s2">"CgroupParent"</span>: <span class="s2">""</span>,
<span class="s2">"ReadonlyPaths"</span>: null
<span class="o">}</span>,
<span class="s2">"NetworkingConfig"</span>: <span class="o">{</span>
<span class="s2">"EndpointsConfig"</span>: <span class="o">{}</span>
<span class="o">}</span>,
<span class="s2">"Platform"</span>: null
<span class="o">}</span>
</code></pre></div></div>
<p>Woah so thats how it does that! As example we can see that the <code class="language-plaintext highlighter-rouge">-v</code> turned into a entry IN <code class="language-plaintext highlighter-rouge">Binds</code> IN <code class="language-plaintext highlighter-rouge">HostConfig</code></p>
<h2 id="conclusion">Conclusion</h2>
<p>This helped me solve a real world problem in software and maybe will you too, it was definitely a useful thing. thats why i like sometimes say i do software engineering & hacking, because isnt that what hacking is? thinking outside the box?
…</p>Liz3So at Giggl we do quite some stuff with Docker and i wanted to do some more specific things with the Docker Engine API.How do time media over the network or when playing back2021-11-23T00:00:00+01:002021-11-23T00:00:00+01:00https://blog.liz3.cat/media-timing<p>So you’ve got your discord bot or a library for playing video files but somethings just off? Lag after some time or even directly from the beginning?
Chances are that maybe the timing is off, and to be fair its really hard to get it right. Heres how to solve it.</p>
<h2 id="the-naive-approach">The naive approach</h2>
<p>Timing video/audio cant be hard can it? Turns out its not as straight forward as you might think.</p>
<p>The Naive and also my first attempt was just to, send <em>x</em> amount of data for a time period, measure how long that takes and then <em>sleep</em> for the time that took.</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>start = now()
to_send = prepare_data() // some encoder/decoder maybe
send_data(to_send) // send data to a blip frame or some network endpoint.
elapsed = now() - start
if elapsed > 0 do
sleep(data_time_amount - elapsed)
end
</code></pre></div></div>
<p>That seams reasonable right?</p>
<h2 id="the-problem">The Problem</h2>
<p>The issue with that approach is that its <em>relative</em>.
The time passed is suspect to the operating system suspending the process, giving it other priority and other factors.
Which means while the approach is <em>theoretically</em> correct, its not going to work unless there is 0 delay beyond your desired one, which will never happen.</p>
<p>Regarding that its also interesting because you learn about kernel schedulers, when i did this, it was often more a problem on macOS then on gnu/linux because the linux kernel scheduler is a lot more aggressive and resource <em>giving</em> then macOS, macOS will make sure its own services have enough priority to keep certain things like the desktop running smoothly.</p>
<h2 id="the-solution">The solution</h2>
<p>I put <em>relative</em> in the previous section in italic for a reason because in that problem is the solution, we need to time in a <em>absolute</em> approach.
That works because(assuming we know the audio packet/frame or video frame duration) we can calculate the position we <strong>should</strong> reach.</p>
<p>Great how do we do that?</p>
<p>Here the solution in c++ from my project <a href="https://github.com/liz3/tokio">tokio</a> in c++</p>
<div class="language-cpp highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="cp">#include <thread>
#include <chrono>
</span><span class="k">using</span> <span class="k">namespace</span> <span class="n">std</span><span class="o">::</span><span class="n">chrono</span><span class="p">;</span>
<span class="c1">// ...</span>
<span class="n">high_resolution_clock</span><span class="o">::</span><span class="n">time_point</span> <span class="n">start_point</span> <span class="o">=</span> <span class="n">high_resolution_clock</span><span class="o">::</span><span class="n">now</span><span class="p">();</span>
<span class="kt">size_t</span> <span class="n">elapsed_frames</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="k">const</span> <span class="kt">double</span> <span class="n">frame_duration</span> <span class="o">=</span> <span class="mf">0.02</span><span class="p">;</span>
<span class="k">while</span><span class="p">(</span><span class="n">should_play</span><span class="p">)</span> <span class="p">{</span>
<span class="n">send_data</span><span class="p">();</span>
<span class="n">elapsed_frames</span><span class="o">++</span><span class="p">;</span>
<span class="n">high_resolution_clock</span><span class="o">::</span><span class="n">time_point</span> <span class="n">point_now</span> <span class="o">=</span> <span class="n">high_resolution_clock</span><span class="o">::</span><span class="n">now</span><span class="p">();</span>
<span class="n">duration</span><span class="o"><</span><span class="kt">double</span><span class="o">></span> <span class="n">absolute_elapsed</span> <span class="o">=</span> <span class="n">duration_cast</span><span class="o"><</span><span class="n">duration</span><span class="o"><</span><span class="kt">double</span><span class="o">>></span><span class="p">(</span><span class="n">point_now</span> <span class="o">-</span> <span class="n">start_point</span><span class="p">);</span>
<span class="kt">double</span> <span class="n">current_play_head</span> <span class="o">=</span> <span class="n">frame_duration</span> <span class="o">*</span> <span class="n">elapsed_frames</span><span class="p">;</span>
<span class="kt">double</span> <span class="n">to_delay</span> <span class="o">=</span> <span class="n">current_play_head</span> <span class="o">-</span> <span class="n">absolute_elapsed</span><span class="p">.</span><span class="n">count</span><span class="p">();</span>
<span class="k">if</span><span class="p">(</span><span class="n">to_delay</span> <span class="o">></span> <span class="mi">0</span><span class="p">)</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">this_thread</span><span class="o">::</span><span class="n">sleep_for</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">chrono</span><span class="o">::</span><span class="n">microseconds</span><span class="p">((</span><span class="kt">int</span><span class="p">)</span> <span class="p">(</span><span class="n">to_delay</span> <span class="o">*</span> <span class="mi">1000000</span><span class="p">)));</span>
<span class="p">}</span>
<span class="p">}</span>
</code></pre></div></div>
<p>So what do we do here?
First we need to know 2 things:</p>
<ol>
<li>the current time in a high resolution - <code class="language-plaintext highlighter-rouge">start_point</code></li>
<li>how long in absolute time one iteration of our loop passes, here <code class="language-plaintext highlighter-rouge">frame_duration</code> 2% of a second.</li>
</ol>
<p>In the loop we send our data and then increment a simple counter per iteration.</p>
<p>Then we calculate the <strong>absolute</strong> time elapsed since we started playing(<code class="language-plaintext highlighter-rouge">absolute_elapsed</code>), that gets rid of that relative issue from the naive approach.
After that we calculated the <code class="language-plaintext highlighter-rouge">current_play_head</code>, basically where the audio should be after the sleep we are now starting.
Lastly we calculate the actual amount to sleep(<code class="language-plaintext highlighter-rouge">to_delay</code>) by substracting the elapsed time from the play head.</p>
<p>Then if needed we sleep by that amount.</p>
<h2 id="conclusion">Conclusion</h2>
<p>I learned this way of calculating by reading the discord.py source code and how they do it.</p>
<p>I hope you where able to take something from this and maybe even use it!</p>Liz3So you’ve got your discord bot or a library for playing video files but somethings just off? Lag after some time or even directly from the beginning? Chances are that maybe the timing is off, and to be fair its really hard to get it right. Heres how to solve it.How Disney ruined Star Wars2021-08-10T00:00:00+02:002021-08-10T00:00:00+02:00https://blog.liz3.cat/how-disney-killed-star-wars<p>Im a huge star wars fan, theres no doubt in that, its amazing how the first 6 parts combine science-fiction with spiritual topics and even some deep theming.
Of course its not perfect. Lucasfilm didnt always do everything perfect and its still confusing how they wrote out the Anakin & Padmé to she being what, 18 years older? but thats another topic.</p>
<h2 id="how-the-problem-was-able-to-be-created">How the problem was able to be created</h2>
<p>The first 6 parts where compared to the later parts a lot more serious. Not necasserily really darker, but they definitely had more seriousness to them.
Why is that?</p>
<p>In the first 6 movies the emphasis is strongly on holding to the code of the jedi and following it closely. A good example is the 2 part when Anakin asks the ship to be landed and he gets in an argument with his master kenobi.</p>
<p>Theres also a great focus on the aspect of master/apprentice and the fact you should be thriving to get more closely with the force and become wiser.
That does not mean there cant be fun, in the second and third part how count doku tries to hold his fights very very “english style” being polite is one example.</p>
<p>And lastly while yes of course it was possible to do things which even in the star wars galaxy where crazy there was still a system behind it, disney broke the system a lot of times for no real reasons.</p>
<h2 id="the-problem">The Problem</h2>
<p>Disney!</p>
<p>Disney tried to turn star wars into a bad comedy show half serious in the star wars franchise?</p>
<p>One of my facorite examples is in the 8th film where Snoke tries to recrute kailo and speaks: “a new Vader”, which is just mind boggling. Vader was created because anakin over estimated his skills in a battle with his old master kenobi. Vader was just the name.
I shows how little disney tried to develop the story and how desperately they tried to not let old characters disappear. a good counter example is kenobis master Qui-Gon Jinn, he was one of the main actors in the first part and had one more appearance at the end of the 3 part. but thats it. he character is gone.</p>
<p>Another example that shows how they couldnt let characters go, is how lea saved herself randomly out of space pulling herself back to the ship using the force, yes theres the jedi jump but this would not hve been possible normally, again becasuse they couldnt let a main character die.</p>
<p>Then the scene where rai gives luke anakins light saber and he just throws it away…disney trying to be funny in the wrong way. In a normal star wars he would have maybe also turned down the request to train ray, but not in that way.</p>
<p>I could give endless more examples but i think i made the point.</p>
<h2 id="how-to-solve-the-problem">How to solve the problem</h2>
<p>Bring back the old style to think about the force, manners and the style to write the films.</p>
<p>But most importanly. LET GO OF MAIN CHARCTERS, move the story.
Yes they let Luke, lea and han go but bring back palpatine without explanation?!</p>
<p>And please also film some scenes on coruscant, i miss that place.</p>Liz3Im a huge star wars fan, theres no doubt in that, its amazing how the first 6 parts combine science-fiction with spiritual topics and even some deep theming. Of course its not perfect. Lucasfilm didnt always do everything perfect and its still confusing how they wrote out the Anakin & Padmé to she being what, 18 years older? but thats another topic.