Skip to content

Instantly share code, notes, and snippets.

View BaronKimaru's full-sized avatar
💭
Eat 🍿 * Sleep 🛌 * Code💻 * Repeat♻️

baronkimaru BaronKimaru

💭
Eat 🍿 * Sleep 🛌 * Code💻 * Repeat♻️
View GitHub Profile
@BaronKimaru
BaronKimaru / create_wagtail_boilerplate_project.md
Last active July 13, 2025 14:50
Creation of Wagtail Project Implementation (Boilerplate)
  1. Create your project and cd into it
cd creskuzaimsproject && cd creskuzaimsproject
  1. Create your project and cd into it
cd creskuzaimssrc && cd creskuzaimssrc
  1. Outside your src directory, create your virtual environment: cd .. && virtualenv venv --python=c:/python3107/python.exe
@BaronKimaru
BaronKimaru / django_howto_display_imagefield_in_html.md
Last active May 12, 2025 12:04
django display Model's ImageField in HTML
  • To add an image in a Django ModelForm for editing, you need to ensure your model has an ImageField, configure your form, and handle the image upload properly in your template and views. Here's a concise example:
  1. Model Ensure your model has an ImageField:
from django.db import models

class Profile(models.Model):
    name = models.CharField(max_length=100)
@BaronKimaru
BaronKimaru / wifi_working_iwlwifi.md
Last active January 9, 2025 08:40
fix wifi not working iwlwifi -hp probook ubuntu 22.04 LTS

problem:

wifi not working in ubuntu 22.04 Screenshot from 2025-01-09 10-53-51

  • run sudo dmesg | grep iwlwifi to see the issue Screenshot from 2025-01-09 11-00-31

  • run lspci to find the Network controller. Screenshot from 2025-01-09 10-55-20

@BaronKimaru
BaronKimaru / wsa_fix_android_app_installs.md
Last active December 21, 2024 05:38
Solution: Apps not installing after Windows Subsystem for Android installation

Problem:

Upon trying to install an android app, the 'Retry' message keeps showing

Solution:

  1. Enable "Developer mode" by clicking on Advanced Settings once Windows Subsystem for Android (WSA) has booted up. wsa - make sure developer mode is on

  2. Click on Manage Developer Settigns just to get WSA to start up .. again

  3. A new prompt to Allow WSA to be recognized by the computer (denoted by RSA fingerprint eg xxxx:xxx) should appear. Click 'Allow' wsa - click on this to start wsa and RSA fingerprint message will appear once started

@BaronKimaru
BaronKimaru / invalid BusinessShortCode.md
Last active January 30, 2025 07:14
EXAMPLES OF INFURIATING SAFARICOM DARAJA API ERRORS AND SOLUTIONS

Sample: python

payload = {
        "BusinessShortCode": "174379",
        "Password": api_encrypting_password,
        "Timestamp": current_time,
        "TransactionType": "CustomerPayBillOnline",
        "Amount": "1",
        "PartyA": "25472XXXXXXX",
        "PartyB": "174379",
@BaronKimaru
BaronKimaru / solution_aborted_upgrade_2004-22.md
Last active December 26, 2023 10:21
solution to Aborted Upgrade - ubuntu 20.04 (Bionic Beaver) to ubuntu 22.04 (Jammy Jellyfish)

The Error:

Restoring system to original state

Abort

the Error

The Solution:

@BaronKimaru
BaronKimaru / dist-infoError.md
Last active June 8, 2023 05:13
pythonanywhere unable to create virtualenv - no .dist-info Error.md

Problem:

RuntimeError: 
no .dist-info at /home/[YOUR USERNAME]/.local/share/virtualenv/wheel/3.8/image/1/CopyPipInstall/pip-22.1.2-py3-none-any, has pip
  • I was always getting this error whenever i tried to create a virtual environment through pythonanywhere. tried everything (and I mean everything, short of witchcraft) to solve this.
  • Turns out that this last resort below saved me

Solution

@BaronKimaru
BaronKimaru / syntax error near ")": solution.md
Last active January 31, 2025 15:05
Solve: django.db.utils.OperationalError: near ")": syntax error

My Code:

from django.db import migrations


class Migration(migrations.Migration):

    dependencies = [
 ('wagtailcore', '0066_collection_management_permissions'),
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@BaronKimaru
BaronKimaru / find_port_and_kill_task.md
Last active October 26, 2021 07:13
Find Port and Kill Specific Process

Netstat - Display ports

  • We use netstat to Display Network protocols as well as TCP/IP connections
  • Here's a full blow-by-blow account of what it can do
C:\WINDOWS\system32>netstat -h

Displays protocol statistics and current TCP/IP network connections.

NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-t] [-x] [-y] [interval]