Skip to content

Instantly share code, notes, and snippets.

View mhitza's full-sized avatar

Marius Ghita mhitza

View GitHub Profile
@mhitza
mhitza / sculpin_for_github_pages.md
Last active August 22, 2023 17:16
Sculpin for Github pages

After a couple hesitating months to move to github pages, and from my hacked together static site generator, yesterday was my 4th attempt in getting started with github pages blogging, just because there where a few annoyances with the different variations I've tried.

Decided to go with Octopress, just for their nice logo. And for their Github pages oriented focus. That didn't pan out, but at least I learned a few things about their blogging process and setup, which I'm adapting for sculpin.

Sculpin for Github pages (Déjà vu)

@mhitza
mhitza / psp_on_linux.md
Created October 8, 2015 02:37
How to connect your PSP on Linux

It should work by default when connected, however you might reach this page with the same issue I had, where you where missing a few essential steps.

  1. Be sure that your PSP is set into USB mode: Settings -> USB connection
  2. Be sure the kernel module usb-storage is enabled, you can check with sudo modinfo usb-storage and enable it with sudo modprobe usb-storage
  3. Reconnect your cable after trying any of the previous steps
  4. If it doesn't get automounted, run dmesg to find the device (on my local machine it's sdb as seen in the output) and mount it manually (prefered with your user access rights so you don't have to use sudo for file copy)
@mhitza
mhitza / Makefile
Last active November 14, 2024 15:44
Programming Arduino Uno (ATmega386P) in assembly
%.hex: %.asm
avra -fI $<
rm *.eep.hex *.obj *.cof
all: $(patsubst %.asm,%.hex,$(wildcard *.asm))
upload: ${program}.hex
avrdude -c arduino -p m328p -P /dev/arduino-uno -b 115200 -U flash:w:$<
monitor:
@mhitza
mhitza / lvm_snapshots.md
Created March 24, 2016 01:39
LVM snapshots

LVM snapshots are logical volumes that reflect the state of the snapshoted volume at the exact moment in time the snapshot was created. Useful for backups and reference points we can revert back to.

Creating snapshots

$ sudo lvcreate --size 5G --snapshot --name root-backup /dev/vg0/root
  Logical volume "root-backup" created.

Keybase proof

I hereby claim:

  • I am mhitza on github.
  • I am mhitza (https://keybase.io/mhitza) on keybase.
  • I have a public key whose fingerprint is E096 835D F783 5B79 8CFD 7DC3 EA9C C2E8 C590 119A

To claim this, I am signing this object:

@mhitza
mhitza / backlight_timeout.md
Created November 22, 2018 21:31
Prolong keyboard backlight timeout

I have a Dell Inspiron 5570 (5000 series) and for some obscure reason in my default linux instalation the default keyboard backlight timeout is something like 1 second. Doesn't make any sense, what benefit does a keyboard backlight have if I can only see it in the dark only when I'm already typing?

Took a couple of wrong paths searching for a solution until I found how to manually tweak that value. Keyboard backlights configuration files are located under /sys/class/leds and for a Dell laptop the magic file is /sys/class/leds/dell::kbd_backlight/stop_timeout.

There's no option to disable the timeout completely so I've created a systemd service that sets the timeout to 30 minutes (just an arbitrary large value) each time graphical.target is reached.

@mhitza
mhitza / gist:9d0e42aa5f6fa320e5cb1df6b9f46890
Created December 2, 2018 09:47
Transmission build failure
libtool: compile: gcc -DHAVE_CONFIG_H -I. -I./compat -I./include -I./include -g -O2 -Wall -fno-strict-aliasing -pthread -MT bufferevent_openssl.lo -MD -MP -MF .deps/bufferevent_openssl.Tpo -c bufferevent_openssl.c -o bufferevent_openssl.o
bufferevent_openssl.c: In function ‘bio_bufferevent_new’:
bufferevent_openssl.c:106:3: error: dereferencing pointer to incomplete type ‘BIO’ {aka ‘struct bio_st’}
b->init = 0;
^~
bufferevent_openssl.c: At top level:
bufferevent_openssl.c:228:1: error: variable ‘methods_bufferevent’ has initializer but incomplete type
static BIO_METHOD methods_bufferevent = {
^~~~~~
bufferevent_openssl.c:79:27: warning: excess elements in struct initializer
{
"rules": {
"indentation": 4,
"block-opening-brace-space-before": "always",
"block-closing-brace-newline-before": "always",
"block-opening-brace-newline-after": "always",
"selector-list-comma-newline-after": "always",
@mhitza
mhitza / workflow.md
Last active April 12, 2022 12:54
Faster Ansible playbook iteration with tags and Vagrant snapshots

In the last few months, I had to write multiple Ansible playbooks, to the point that the slow write/test cycle became a major annoyance. What seemed to work well for me was a mix between Ansible tags and Vagrant snapshots. I would be happy to hear what workflow others employ, that specifically minimizes the time they spend testing.

Setup

Vagrantfile

Vagrant.configure("2") do |config|
@mhitza
mhitza / vimwiki.md
Last active June 19, 2020 09:20
Using Vimwiki like a standard desktop application

I've started using [Vimwiki][0] recently, mostly for note keeping, and this post is about how I integrated it into my workflow.

The main feature I use from Vimwiki is the Diary. And the way I've used past note taking applications were always in short bursts.

  1. Have an idea
  2. Launch the note-taking application
  3. Type in note
  4. Quit application.