Skip to content

Instantly share code, notes, and snippets.

@t0mab
t0mab / github-notifications
Created April 6, 2017 09:07 — forked from mdibaiee/github-notifications
GitHub Notifications in i3bar
#!/bin/bash
# put this in your bin directory, e.g. /usr/bin or ~/.local/bin
sleep 20 # update interval
# you have to generate a new ACCESS_TOKEN for yourself here (https://github.com/settings/tokens, you only need "notifications" access) and replace the value
response=$(curl -s https://api.github.com/notifications?access_token=ACCESS_TOKEN)
if [[ $response =~ "{" ]]
@t0mab
t0mab / C-states.md
Created October 28, 2016 08:30 — forked from wmealing/C-states.md
What are CPU "C-states" and how to disable them if needed?

To limit a CPU to a certain C-state, you can pass the processor.max_cstate=X option in the kernel line of /boot/grub/grub.conf.

Here we limit the system to only C-State 1:

    kernel /vmlinuz-2.6.18-371.1.2.el5 ... processor.max_cstate=1

On some systems, the kernel can override the BIOS setting, and the parameter intel_idle.max_cstate=0 may be required to ensure sleep states are not entered:

@t0mab
t0mab / 3-postgres-tips.md
Created October 17, 2016 15:12 — forked from nepsilon/3-postgres-tips.md
3 tips for a better PostgreSQL usage — First published in fullweb.io issue #38

3 tips for a better PostgreSQL usage

We’ll see how to write queries in your editor, format output based on content and how to get info on everything.

1. Use your editor to write queries:

Tell the terminal what editory to use with from your bash shell export EDITOR=subl, then in psql type:

psql> \e
@t0mab
t0mab / fuzzy-search-postgres.md
Created October 17, 2016 15:12 — forked from nepsilon/fuzzy-search-postgres.md
PostgreSQL: Native fuzzy search with levenshtein() — First published in fullweb.io issue #41

PostgreSQL: Fuzzy search with levenshtein()

Ever wanted to implement a “Did you mean?” feature in your search results? Google is said to have greatly increased its user engagement with it. Here is how to implement it simply in Postgres (v9.1+):

Install the extension:

CREATE EXTENSION fuzzystrmatch;
@t0mab
t0mab / 2-front-end-tips-to-keep-in-mind.md
Created October 17, 2016 14:58 — forked from nepsilon/2-front-end-tips-to-keep-in-mind.md
2 front-end tips to keep in mind — First published in fullweb.io issue #68

2 front-end tips to keep in mind

1. Stop using .innerHTML = ''; when removing children to a DOM element.

On modern browsers it seems to be about 400× (!!) slower than this DOM-friendly method:

while (el.firstChild)
    el.removeChild(el.firstChild);
@t0mab
t0mab / autoexec.ash
Created July 31, 2016 16:40 — forked from KonradIT/autoexec.ash
GoPro HERO4 Session improvement hack (makes MSC USB connection and enables 10 second OLED screen timeout to save battery)
#Hack for hero4 session, makes it even more stoked and versatile.
t app usb msc
sleep 10
t app test oled brightness 0
@t0mab
t0mab / README.md
Created July 31, 2016 16:40 — forked from KonradIT/README.md
HERO+LCD hacking (Ambarella A7)

#HERO+ LCD hacking

#####All in one awesome

###Out of the box features:

  • Video:
  • Single video, Resolutions: 1080p 60/30, 720p 60/30 w/ SuperView
  • Looping
  • Photo:
@t0mab
t0mab / README.md
Created July 31, 2016 16:38 — forked from KonradIT/readme.md
GoPro Studio for Linux

####GoPro Protune correction, timelapse assembling, fisheye removal, slow motion, 4:3 to 16:9 and motion blur in Linux OS - GoPro Studio for Linux - KDEnlive, FFMPEG, ImageMagick, Mencoder and Python!

GoPro Studio has been tremendously useful for GoPro users, but not all GoPro users can enjoy the tool, there is no GoPro Studio for Linux. So some users made their ways to emulate GoPro Studio on Linux.

This guide is more than GoPro Studio, is a must read guide for Linux and GoPro users.

The main features of GoPro Studio are:

  • Convert and edit Protune footage and apply Protune effect.
  • Convert 4:3 footage to 16:9
  • Slow motion
# Stolen from https://adrhc.go.ro/wordpress/ thanks man !!!!!
See also
# https://doc.ubuntu-fr.org/optimisation
Check ubuntu startup times
systemd-analyze blame
/etc/fstab
# http://www.lgqyc.com/move-tmp-to-ram/
@t0mab
t0mab / arch-linux-install.md
Last active October 24, 2016 09:34 — forked from Thrilleratplay/arch-linux-install.md
Installing Arch Linux on an LUKS Encrpyted root and booting from UEFI