Skip to content

Instantly share code, notes, and snippets.

View sacsbrainz's full-sized avatar
💻
Typescript

Solomon ogu sacsbrainz

💻
Typescript
View GitHub Profile
@sacsbrainz
sacsbrainz / Fix.md
Last active March 26, 2024 22:23
Automatic wakeup on laptop running linux

kill-enabled.sh

#!/bin/bash

# Check if the script is run as root
if [ "$(id -u)" -ne 0 ]; then
@sacsbrainz
sacsbrainz / install.sh
Last active December 16, 2023 15:14
install docker on MX Linux
#!/usr/bin/env bash
# Prompt user for password
sudo -v
# Update package information
sudo apt update
# Install necessary packages
sudo apt-get install -y ca-certificates curl gnupg tree
@sacsbrainz
sacsbrainz / install-docker-deepin.sh
Last active December 14, 2023 21:06 — forked from madkoding/install-docker-deepin.sh
Install Docker-CE script for Deepin Linux
#!/bin/bash
echo "Starting Docker installation on Deepin Linux..."
# Define a mapping from Deepin version to Debian version
map_deepin_to_debian() {
case "$1" in
20*) echo "buster" ;; # Replace with the correct mapping for Deepin 20
15*) echo "stretch" ;; # Replace with the correct mapping for Deepin 15
*) echo "buster";;
@sacsbrainz
sacsbrainz / configuration.nix
Created October 5, 2023 14:32
configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
config,
pkgs,
lib,
...
}: {
imports = [
@sacsbrainz
sacsbrainz / fix.md
Created September 11, 2023 14:38
fix chrome strange image / missing images views on chrome

delete this folder

~/.config/google-chrome/Default/GPUCache
@sacsbrainz
sacsbrainz / fix.md
Created September 4, 2023 14:25
fix bad superblock on ntfs drives/partitions

make sure you have ntfs-3g installed

run this code

ntfsfix -b -d /dev/sdb6

@sacsbrainz
sacsbrainz / fix no bootable device error in nixos.md
Last active December 13, 2023 20:24
fix no bootable device error in nixos

Prerequisite

insert a nixos bootable drive

run this command to get list of drives

lsblk

enter sudo mode

@sacsbrainz
sacsbrainz / fix_git.md
Last active August 30, 2023 18:55
Git not picking up changes correctly after copy or os change

run this command to see you old and new mode also look out for the last 3 numbers as this represents the permissions

git diff -G.

so after this we can see the issue, our permissions changed

to fix this they are 2 ways

  1. run this command in the root directory of your project and it will fix the permissions

find . -type f -exec chmod a-x {} \;

@sacsbrainz
sacsbrainz / configuration.nix
Created July 26, 2023 05:47
my configuration.nix
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{
config,
pkgs,
lib,
...
}: {
imports = [
signUp: publicProcedure
.input(registerSchema)
.mutation(async ({ input, ctx }) => {
const transformedPhoneNumber = input.phoneNumber.replace(/^0/, "+234");
// check if user exists
const exists = await ctx.prisma.user.findUnique({
where: {
email: input.email,
},