Categories
Uncategorized

How to edit credentials in Ruby on Rails on Windows

I have spent hours struggling with this nonsense. Short answer for me was to install vim: https://www.vim.org/download.php on Windows and then to run the following two commands:

set EDITOR="vim"
rails credentials:edit

I tried to do it with Visual Studio Code and Notepad but the issue for me was that the configuration file was not saved after VS Code or Notepad was closed. It looks like Ruby on Rails, at least on my side, expected the editor to run in the same terminal!

Anyways I hope that this has helped you edit credentials on Windows.

Categories
Ideas

My experience on microaggression

This post is part of a blog parade on microaggression: https://shau-chung-shin-not-ching-chang-chong.com/blog-parade-microaggressions/ If you would like to read more of this type of posts check them out ๐Ÿ™‚

Most of my experience is in Mauritius, a culturally diverse island in the Indian Ocean. The majority of Mauritians are Hindus, just like me, so the microaggression that I experienced was based on my appearance.

“4 Eyes” in High School

Life was pretty good in primary school. At that time in Mauritius you moved directly to High School after finishing primary school. Things changed when I turned 12. Just like my father, I was now experiencing nearsightedness and had to wear glasses. And this is when the comments/microaggression started.

Kids can be mean and I think teenagers are much meaner. There have many occasions where I was called “4 eyes” in high school. To be frank I never understood the logic. I think it’s annoying only the first few years and after a while you realize that most of the other teenagers also have some kind of nickname.

On the positive end of that stereotype for some reason people who met me for the first time thought that I was de facto smart and good at programming. (Both of which turned out to be true anyways ๐Ÿ˜Ž)

My Village Accent

This one is in my opinion slightly worse. Islanders, specially at that time, lived in their own bubbles. I have grown in what you would call a village and had picked up an accent. I would pronounce anything with ร‰ differently (It actually took me a while to understand that I was saying it differently).

*Side Note: We speak creole in Mauritius which is made up of French words mostly.

To help you understand what I mean, you could compare it with how French is spoken in Quebec. The microaggressions have caused me to try to correct them but there are still a few times when the accent comes out and I am made fun of.

I have barely experienced it here in Europe obviously as I meet far fewer Mauritians, which is refreshing.

Replying Back In English

I have been travelling more frequently in Europe and to a few French speaking countries. I am not sure whether this is categorized as Microaggression but a lot of times when I go to the supermarket and I speak French to the cashiers(they speak French to others), they reply to me in English and also do not ask me for loyalty cards and things like that. Actually this happens even in Luxembourg where I am currently residing (well double actually only in Delhaize, not in Auchan or Cactus).

Anyways I don’t mind it that much, must be hard for some of them to compute a brown guy speaking French.

I think stereotyping has a lot to do with microaggression.

Conclusion

All in all I don’t really mind microaggressions as much anymore and I don’t blame those who did it as well. If you are confused about what a microaggression is, I will leave you with this educational video from a South Park video game:

Categories
Administration

How to delete all pods from a specific namespace with kubectl?

Run the following to get all namespaces exactly:

kubectl get pods --all-namespaces

The first column shows the namespaces and the second column shows pods as follows:

NAMESPACE      NAME                                       READY   STATUS             RESTARTS        AGE
kube-flannel   kube-flannel-ds-skdpx                      0/1     CrashLoopBackOff   20 (3m6s ago)   27m
kube-system    coredns-64897985d-kfssj                    0/1     Pending            0               10m
kube-system    coredns-64897985d-p96wd                    0/1     Pending            0               10m
kube-system    etcd-ip-172-31-45-235                      1/1     Running            0               34m
kube-system    kube-apiserver-ip-172-31-45-235            1/1     Running            0               34m
kube-system    kube-controller-manager-ip-172-31-45-235   1/1     Running            0               34m
kube-system    kube-proxy-vttwh                           1/1     Running            0               34m
kube-system    kube-scheduler-ip-172-31-45-235            1/1     Running            0               34m

You can also run the following command to get all pods from the namespace if there are too many, for example from kube-flannel:

kubectl get pods --namespace=kube-flannel

Replace kube-flannel with any other namespace you want.

Next to delete pods from kube-flannel or any namespace run the following

kubectl delete pods kube-flannel-ds-skdpx --namespace=kube-flannel

Replace kube-flannel-ds-skdpx with the name of your pod.

Finally if you want to delete the namespace with kubectl:

kubectl delete namespace kube-flannel

This is really annoying from kubectl I really wish there was easier way so let me know if you have one in the comments!

Categories
Development

Step by Step guide on how to get started with Drogon on Windows with Visual Studio

This blog post explains step by step (in as much detail as I could remember) how to start working with the world’s fastest web framework on TechEmpower’s Fortune benchmarks (at the time of writing) Drogon c++ on Visual Studio on Windows 10.

Disclaimer that this was only tested with Visual Studio 2022

TechEmpower’s Fortune benchmark covers ORM, database connectivity, dynamic-size collections, sorting, server-side templates, XSS countermeasures, and character encoding

Step 1: Install Visual Studio

If you install Visual Studio 2022 you will by default install vcpkg together with it. There is a limitation with that version though, it only works in manifest mode. This guide uses the classic mode which means that we will later cover how to install vcpkg independently.

Anyway launch Visual Studio Installer, click on modify then install Desktop Development with C++ as shown in the picture below.

Step 2: How to install vckpg on Windows?

  1. Open a Command Prompt in Administrator mode. This is important for the setup. Without Administrator mode you will get “error: failed to install system targets file vcpkg”.
  2. Follow the steps at https://vcpkg.io/en/getting-started.html which firstly to clone the repo:
  3. git clone https://github.com/Microsoft/vcpkg.git
  4. Run the batch file: .\vcpkg\bootstrap-vcpkg.bat
  5. Start -> type “Edit the system environment Variables” -> “click on “Environment Variables” -> Edit path and add the path to vcpkg as shown below

6. Now open a new command prompt again in administrator mode. Run the following:

vcpkg integrate install

7. Next install drogon by running

vcpkg.exe install drogon[ctl]:x64-windows or

vcpkg.exe install drogon

Step 3. How to make Visual Studio use your custom vcpkg.exe?

  1. Open Visual Studio
  2. Create a CMake C++ Project or clone this sample repo: https://github.com/Lougarou/getting-started-with-drogon-on-windows
  3. Go to Tools->vcpkg Package Manager->Use custom path to vcpkg.exe then point it to the .exe that you have just installed as shown below:

4. Open CMakePresets.json file and point to the custom toolchain file. For example the repo above uses “toolchainFile”: “C:\Users\iamyo\projects\vcpkg\scripts\buildsystems\vcpkg.cmake” which you will need to change to your own.

5. Modify the CMakeLists.txt to use C++ 17 or 14 using the following:

set_property(TARGET blog PROPERTY CXX_STANDARD 17)

6. Modify the CMakeLists.txt of the project to include drogon as follows:

find_package(Drogon CONFIG REQUIRED)
target_link_libraries(blog PRIVATE Drogon::Drogon)

You can check the sample repo to see what it looks like if you are confused as to which file to modify. That’s it you should now be able to compile and run your project on Visual Studio!

Categories
Gaming

What is the best mouse to play Apex Legends?

The best mouse to play Apex Legends or any other FPS game can be any model but what is most important is to know how to find a good mouse. Below are a few qualities that I think are important.

When evaluating a gaming mouse, sensitivity, durability, and ergonomics are three of the most significant factors to consider. These features can significantly impact a player’s overall performance and comfort. In this guide, we will delve into the methodology of testing these crucial aspects to find the perfect gaming mouse.

Testing Sensitivity

Sensitivity is gauged by a mouse’s DPI (Dots Per Inch) and is essential in determining the mouse’s speed and accuracy. High DPI means the cursor will move faster on the screen, while low DPI slows it down, providing more precision.

To test sensitivity, you’ll need a consistent testing environment, preferably a game you’re familiar with, where you can predict the targets. A game with a shooting range or practice mode is perfect for this. Start with a low DPI setting and gradually increase it. Test each setting by trying to hit targets as quickly and accurately as possible. Monitor your comfort level and accuracy at each DPI setting. It is vital to remember that while high DPI mice are often marketed as better, each player’s ideal sensitivity is subjective and dependent on their play style.

Testing Durability

Durability often boils down to the build quality and longevity of the mouse. One of the practical ways to assess a mouse’s durability is by examining its construction. High-quality materials such as a robust plastic or even metal body, reinforced left and right click buttons, and braided cables in the case of wired mice, often signify durability.

To assess the durability over time, you can look at online reviews from users who have used the mouse for extended periods. Pay attention to recurring issues such as double-click problems, wear on the scroll wheel, or deteriorating skates. Also, consider the manufacturer’s warranty period, as this can often indicate the confidence they have in their product’s longevity.

Testing Ergonomics

Ergonomics is all about how comfortable the mouse is during long gaming sessions. An ergonomic mouse should fit well in your hand, support your grip style (palm, claw, or fingertip), and not cause any strain even after hours of use.

When testing ergonomics, consider the size of the mouse relative to your hand and your grip style. The mouse’s weight is also an essential factor: some players prefer a heavier mouse for stability, while others favor a lighter mouse for swift movements. Most high-end gaming mice have customizable weights to accommodate this preference.

Button placement is another factor to consider. All buttons should be easily accessible without straining your fingers. The texture of the mouse also plays a role, with some gamers preferring a smooth finish while others opt for a textured one for better grip.

Lastly, test the mouse over an extended gaming session to see if it causes any discomfort or strain in your hand, wrist, or arm. Keep in mind that ergonomics is highly subjective, and what feels comfortable can vary widely from person to person.

Sensitivity, durability, and ergonomics are key factors in finding a gaming mouse that fits your needs. It involves a combination of objective testing and subjective feeling, as everyone’s preferences differ. By using this guide as a foundation, you can better assess your options and find a mouse that will enhance your gaming performance while providing optimal comfort.

If you would like to read more we have other articles on Apex Legends checkout Can you play Apex Legends with keyboard and mouse on ps4 & ps5 ?

Categories
Management

Leadership in times of crisis – JCI Edition

I recently attended a panel discussion on this exact subject conducted by the Luxembourg School of Business with Paul Green, Jr. from McCombs School of Business and Jan Muehlfeit, former chairman of Microsoft Europe.

And throughout the talk I couldn’t help but to draw a parallel between the discussion and how we form Leaders in JCI.

So what is JCI anyway?

JCI, or Junior Chamber International, has often been referred to as the “world’s best kept secret” because it is not as widely known or recognized as other larger organizations.

This is primarily due to a lack of public awareness as JCI focuses on developing young (18 – 40) leaders and creating local community impact, often resulting in limited media attention. This is particularly true in the African region.

JCI’s decentralized structure and emphasis on individual development can limit its visibility on a global scale. With limited resources for marketing and publicity, JCI’s primary focus is on projects and member development.

Nevertheless, JCI’s impact is significant as it provides valuable leadership opportunities, fosters positive change through community projects, and promotes international collaboration. While it may lack public recognition, its influence is deeply felt by its members and the communities they serve.

Let’s dive deeper into how JCI provides Leadership development opportunities.

Leaders vs Managers

During the panel discussion, the speakers defined the main difference between a Leader and Manager, as someone (Leader) who has a vision, who can inspire people to look beyond an immediate crisis and have a long term perspective for the business. While a manager is more focused on operational efficiency, meeting targets, and resolving immediate challenges.

But the line is blurred in the real world, there should be a balance between both in an individual. And, in my personal opinion, while management skills are widely taught, Leadership qualities are harder to acquire through conventional education.

JCI is the best way that I know of to teach someone Leadership skills.

Leading projects with volunteers

Running projects in JCI is different from running a team in the corporate world and more like running a startup. The main difference that I referring to is paying an employee to work for you.

Throwing money at a problem(or employee in this case) is a solution that one often tends to during recruitment. In JCI you have to make volunteers work on a project for free while taking time off from their personal lives. This requires a whole different set of skills.

  • You have to clearly articulate your vision and connect with the other members to work on the project.
  • You, as a project director, have to lead by example to show your commitment.
  • Your volunteers might come from different backgrounds. For example, may be you are lucky that you have an accountant as volunteer to handle your budget. But in JCI it can happen that you don’t, and in this case you need to know how to empower that member to handle the budget.
  • You have to know how to foster an inclusive environment. The members will only truly devote themselves to the project when they feel that they are being heard. This in turn fosters a sense of ownership, engagement, and shared purpose.

I use volunteer and member interchangeably in the paragraph above but I am referring to the same thing.

Starting projects with 0 budget

The term lean startup has become popular in the past decade. With JCI we go one step further and define a 0 budget project. Disclaimer to anyone from JCI reading this that this is something specific to my local chapter.

What we mean by 0 budget is to start a project with a simulation of an empty bank balance. That is, we only use funds that we can raise for the project. This means sponsorships, partnerships or selling tickets. And at the end of project we make sure that the project either breaks even or has a small surplus.

Sounds hard? Well it is, but it’s the best way to learn Leadership skills. In a way, JCI projects simulate times of crisis and this is why I felt, when attending the panel discussion, that the attendees wouldn’t really learn how to lead in times of crisis unless they actually practice it.

And one way to do that is to join JCI.

How do I join JCI?

JCI is present in more than 100 countries. I would suggest you search for “JCI <insert local town name>”. For example “JCI Curepipe” or “JCI <insert country name>” like “JCI Mauritius” in Google Search.

If you can’t find any then feel free to comment below and I will help you out ๐Ÿ™‚

Categories
Uncategorized

How to fix “Something went wrong. If this issue persists please contact us through our help center at help.openai.com.”?

I struggled a lot with this and turns out that for me, at least, the issue was with my VPN. I used NordVPN so it might be different for your case.

Just disconnecting the VPN was not enough for me. If you are using NordVPN you need to go to Threat Protection and turn off or pause Web Protection as shown in the screenshot below:

Once you do that you can regenerate a response and it should hopefully work.

Reason 2 might be that your browser is using a proxy. Try to turn it off. You will need to look for it depending on the browser that you are using.

The other reason might also be that openai is just overloaded at the moment! Let us know if this helped in the comments ๐Ÿ™‚ Cheers!

Categories
Management

What happens if scrum teams become too large?

In Scrum, it’s recommended that teams are small and cross-functional, typically consisting of 5-9 members. This is because a larger team can make communication and coordination more difficult, and may lead to a loss of efficiency, productivity, and effectiveness.

If a Scrum team becomes too large, some of the potential consequences are:

1. Communication breakdowns

Larger teams may have more difficulty communicating effectively, leading to misunderstandings, missed deadlines, and inefficiencies.

2. Coordination challenges

With more team members, it can be harder to coordinate efforts, plan sprints, and make sure everyone is aligned on the team’s goals and priorities.

3. Difficulty in maintaining focus

Large teams may struggle to stay focused on the most important tasks, leading to delays and lower quality work.

4. Increased overhead

A larger team can require more resources and time to manage, which can create additional administrative overhead.

5. Reduced ownership and accountability

With more team members, individuals may feel less ownership and accountability for their work, which can lead to decreased motivation and productivity.

What is the solution to this problem?

The solution is to split the team into smaller, cross-functional teams. This is known as “scaling Agile” or “Agile at scale”.

1. Scrum of Scrums (SoS)

In this approach, each team sends a representative to a higher-level meeting called the SoS meeting. This meeting focuses on discussing and resolving any cross-team dependencies, risks, and issues. The Scrum of Scrums representative is responsible for communicating the decisions made in the SoS meeting back to their team.

2. Large Scale Scrum (LeSS)

This approach is designed for larger organizations that require multiple Scrum teams to work together. LeSS is based on a set of principles and rules that help to coordinate and align the work of multiple Scrum teams. It includes practices like shared product backlog, joint sprint planning, and joint retrospectives.

3. Scaled Agile Framework (SAFe)

This approach is a comprehensive framework that provides a set of roles, processes, and artifacts for scaling Agile. SAFe is designed to support the coordination and alignment of multiple teams across an enterprise. It includes practices like program increments, value streams, and release trains.

In summary, if a Scrum team becomes too large, the solution is to split the team into smaller, cross-functional teams, and adopt a scaling Agile approach that suits your organization’s needs.

Categories
Development

Why I am dropping Google AMP for this blog

A few years ago in my search to make this blog faster, I discovered Google AMP. The learning curve to get started was acceptable to me and I didn’t have a lot of pages to change to make this happen.

Support for AMP at that time was OK-ish, although it did look like interest in the project was dwindling. I should have probably taken a hint that it was a bad idea to stick with AMP at that time.

Anyway, after modifying the blog’s template, adding AMP ads, removing JS and CSS code to make it AMP compliant I have to admit that despite the PITA that setting up AMP is, I was actually satisfied with the performance improvement it brought me.

But the fact that the latest Google GA4 not yet supported by AMP after so many years and that there is no clear roadmap for its support is what I would say broke the camel’s back for me.

But does Google GA 4 support AMP or plan to support AMP?

In this tweet below dated 4th of May 2023 you can see that although Google plans to support GA4 on AMP there is currently no timeline for them to implement it.

At the time of writing, there are around 60 more days left until GA 4 is the standard and we lose the old analytics. There is a workaround you can try from a third party https://www.thyngster.com/how-to-track-amp-pages-with-google-analytics-4

I would like to add a disclaimer here that I have not tried David’s blog post. Anyway, let’s see what happens.

Categories
Artificial Intelligence

How big are Large Language Models on disk?

This question hit me when I was downloading Galactica-1.3b model from https://huggingface.co/facebook/galactica-1.3b/. The only way I have found so far is to go to the model’s HuggingFace page and then click on Files and Versions. For example for Galactica https://huggingface.co/facebook/galactica-1.3b/tree/main

You should then see something like the following:

screenshot from hugging face showing size of the model

This will show the files in the model. Check pytorch_model.bin and on the right, it should show you the size of the model as pointed by the red arrow in the screenshot. In this case it shows you that the size is 2.63 GB.

Which also means that you need to run git lfs install before downloading the model before git clone https://huggingface.co/facebook/galactica-1.3b/

Of course, this only applies to open source models. If you know any other way to find the size of a LLM let me know in the comments. Thanks!