Skip to content

Instantly share code, notes, and snippets.

View Majunko's full-sized avatar

Ferney Palacio Majunko

View GitHub Profile
@Majunko
Majunko / patch_libxft.sh
Last active February 13, 2024 22:48
Patch for libxft to use emojis in dmenu
#!/bin/bash
git clone https://gitlab.freedesktop.org/xorg/lib/libxft.git
cd libxft
git fetch https://gitlab.freedesktop.org/mawww/libxft.git bgra-glyphs:bgra-glyphs
git checkout -b mawww/libxft-bgra-glyphs FETCH_HEAD
sudo apt install build-essential libtool pkg-config libxrender-dev libfreetype6-dev libfontconfig1-dev xutils-dev
sh autogen.sh --sysconfdir=/etc --prefix=/usr --mandir=/usr/share/man
@Majunko
Majunko / rocket-chat-denied-mask.sh
Last active December 11, 2023 18:32
Rocket Chat Server - Repair Denied mask spam in journal
#! /bin/bash
# =====================
# USE AT YOUR OWN RISK.
# =====================
# This script can be used in crontab, rc5 (/etc/init.d), service, or execute directly.
# It's just a temp fix to this annoying problem, you have to run it on every boot of the system.
# Related to:
@Majunko
Majunko / semaphore.c
Last active January 23, 2020 17:51
Semaphores implementation in C
/*
Source Video: https://www.youtube.com/watch?v=Om2t1xgEUQE
Demo by Shriram K Vasudevan. Semaphore Concept with Linux System Calls
Refer to shared memory video once, before you come here, it would be very easy, otherwise would be a bit of struggle
Let us explain Semaphore first!! Assume the usage of Traffic Signals or olden day railway Semaphore!
Here, we use semaphore to access an available single resource more efficiently. Means, when so many processes try to access,
it will require a semaphore to access the resource one after another. The resource is a very simple integer pointer here.
@Majunko
Majunko / Handler.php
Last active October 28, 2019 21:47
My list of exceptions in Laravel 5.* API
<?php
/*
This is very userful when you're using Rest Api from laravel, to catch errors.
All the responses are sended in json format.
File: app/Exceptions/Handler.php
*/
namespace App\Exceptions;
@Majunko
Majunko / blob.html
Created July 16, 2019 17:51
How to retrieve a image using blob with JQuery
<!--A litle example to retrieve a image using blob with JQuery-->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Example Blob With JQuery</title>
</head>
<body>
<img id="photo">
@Majunko
Majunko / reset_root_password_mysql.md
Last active June 13, 2019 16:28
reset root password MySQL 5.7

This is a common error in Ubuntu when you install MySQL and phpMyAdmin, you can not log in into phpMyAdmin. So this is the solution:

Stop MySQL

sudo service mysql stop

Make MySQL service directory

sudo mkdir /var/run/mysqld

Give MySQL user permission to write to the service directory

@Majunko
Majunko / urls.py
Last active April 30, 2019 17:30
Custom errors page in Django 2.0 >=
from django.conf.urls import (
handler400, handler403, handler404, handler500
)
handler400 = 'myapp.views.handler400'
handler403 = 'myapp.views.handler403'
handler404 = 'myapp.views.handler404'
handler500 = 'myapp.views.handler500'
urlpatterns = [