Skip to content

Instantly share code, notes, and snippets.

View neumachen's full-sized avatar
🏠
Working from home

Kareem H neumachen

🏠
Working from home
  • Bergen, Norway
  • 00:20 (UTC -12:00)
View GitHub Profile
@neumachen
neumachen / macos-tmux-256color.md
Created September 18, 2021 06:26 — forked from bbqtd/macos-tmux-256color.md
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

@neumachen
neumachen / docker-increase-inotify-max-user-watches.md
Created September 13, 2021 12:21 — forked from tsrivishnu/docker-increase-inotify-max-user-watches.md
Increase inotify watchers in Docker images during build

Increasing fs.inotify.max_user_watches for Docker images

TL;DR You can't set those for an image during build time becasue Docker takes the sysctl configuration from the Host. So, set the config on your host machine.

As in this link, to increase the maximum watchers, we need set fs.inotify.max_user_watches to a higher number in /etc/sysctl.conf.

@neumachen
neumachen / .ctags
Created September 13, 2021 07:17 — forked from romainl/.ctags
My ctags config
--langdef=less
--langmap=less:.less
--regex-less=/^[ \t&]*#([A-Za-z0-9_-]+)/\1/i,id,ids/
--regex-less=/^[ \t&]*\.([A-Za-z0-9_-]+)/\1/c,class,classes/
--regex-less=/^[ \t]*(([A-Za-z0-9_-]+[ \t\n,]+)+)\{/\1/t,tag,tags/
--regex-less=/^[ \t]*@media\s+([A-Za-z0-9_-]+)/\1/m,media,medias/
--regex-less=/^[ \t]*(@[A-Za-z0-9_-]+):/\1/v,variable,variables/
--regex-less=/\/\/[ \t]*(FIXME|TODO)[ \t]*\:*(.*)/\1/T,Tag,Tags/
--langdef=scss
@neumachen
neumachen / advancedsettings.xml
Created August 3, 2021 02:45 — forked from htpcBeginner/advancedsettings.xml
AdvacedSettings.xml for Kodi with MySQL and other tweaks.
<!-- General Settings -->
<advancedsettings>
<loglevel hide="true">-1</loglevel> <!-- Comment: Disables logging -->
<playcountminimumpercent>95</playcountminimumpercent>
<skiploopfilter>0</skiploopfilter> <!-- Comment: For RPi or similar use 16 or higher (low CPU usage) -->
<nodvdrom>true</nodvdrom>
<!-- MySQL Library -->
<videodatabase>
<type>mysql</type>
@neumachen
neumachen / advancedsettings.xml
Created August 3, 2021 02:38 — forked from UndeadKernel/advancedsettings.xml
Good parsing settings for Kodi
<advancedsettings>
<video> <!-- Stop XBMC indexing some unwanted common items -->
<excludetvshowsfromscan action="prepend">
<regexp>(?i)sample</regexp> <!-- Greedy, whole path, case insensitive ignore -->
<regexp>(?i)uTorrentPartFile</regexp> <!-- Ignore common scrap files -->
<regexp>[\/\\][sS]pecials?[\/\\]</regexp>
<regexp>[\/\\][Ee]xtras?[\/\\]</regexp>
<regexp>(?i)[\. \-_](?:nc)?(?:op|ed|sp|pv)[\. \-_\(\[\d]</regexp>
</excludetvshowsfromscan>
</video>
@neumachen
neumachen / caller.go
Created June 7, 2021 17:32 — forked from ribice/caller.go
A robust rabbitmq client for Go
go func() {
for {
err = rmq.Stream(cancelCtx)
if errors.Is(err, rabbitmq.ErrDisconnected) {
continue
}
break
}
}()
@neumachen
neumachen / nestedmaplookup.go
Created May 21, 2021 19:14 — forked from ChristopherThorpe/nestedmaplookup.go
Nested Map Lookup: find elements in golang maps of arbitrary depth
// NestedMapLookup implementation and usage example
// Run it at https://play.golang.org/p/VHRgMcLf0b1
//
// JSON is not required, but used to show the example in a "real" setting.
//
// This gist is copyright (c) 2018 Brightgate Inc.
// and licensed under the Creative Commons Attribution 4.0 International license
// https://creativecommons.org/licenses/by/4.0/legalcode
//
@neumachen
neumachen / Awesome_GO.md
Created May 5, 2021 19:53 — forked from aljiwala/Awesome_GO.md
Awesomeness of Golang by uhub

#awesome-go

A curated list of awesome Go frameworks, libraries and software.

@neumachen
neumachen / conventional-json.go
Created April 11, 2021 01:35 — forked from Rican7/conventional-json.go
Marshal JSON in Golang using common lower-snake-case object key conventions
package main
import (
"bytes"
"encoding/json"
"fmt"
"regexp"
"time"
)
@neumachen
neumachen / cheatsheet-elasticsearch.md
Created March 5, 2021 04:01 — forked from ruanbekker/cheatsheet-elasticsearch.md
Elasticsearch Cheatsheet : Example API usage of using Elasticsearch with curl