Skip to content

Instantly share code, notes, and snippets.

View czekaj's full-sized avatar
💻
Hacking

Lucas Czekaj czekaj

💻
Hacking
View GitHub Profile
@czekaj
czekaj / Synology-find-too-long-filenames.sh
Created February 23, 2019 00:37
Synology NAS has filename limits for encrypted shares. If the name of a file has more than 143 characters it will fail the write operation. This short script will let you find all these files.
#!/bin/bash
find . -maxdepth 15 | perl -nle'print if m{\/[^\/]{143,}[^\/]}'
@czekaj
czekaj / wakeup-fix.service
Last active January 10, 2019 22:26
Sleep fix to prevent USB devices from waking Lenovo X1 Carbon 3rd gen up on Ubuntu 18.10
# Put the below in /etc/systemd/system/wakeup-fix.service
#
# then do
# sudo systemctl daemon-reload
# sudo systemctl start wakeup-fix
#
# and check on it with
# systemctl status wakeup-fix
#
# then enable it so it starts after boot with
@czekaj
czekaj / git-serve.md
Created June 19, 2018 20:54 — forked from datagrok/git-serve.md
How to easily launch a temporary one-off git server from any local repository, to enable a peer-to-peer git workflow.

Launch a one-off git server from any local repository.

I [tweeted this already][1] but I thought it could use some expansion:

Enable decentralized git workflow: git config alias.serve "daemon --verbose --export-all --base-path=.git --reuseaddr --strict-paths .git/"

Say you use a git workflow that involves working with a core "official" repository that you pull and push your changes from and into. I'm sure many companies do this, as do many users of git hosting services like Github.

Say that server, or Github, goes down for a bit.

@czekaj
czekaj / sleep-fixes
Created May 30, 2018 00:39
Fixes touchpad scrolling after resume from sleep on Lenovo Thinkpad X1 Carbon 3rd Gen running Ubuntu 18.04. Remember to sudo when creating this file and chmod +x it
# $ pwd
# /lib/systemd/system-sleep
# $ cat sleep-fixes
#!/bin/sh
case $1/$2 in
pre/*)
echo "Going to $2..."
# Place your pre suspend commands here, or `exit 0` if no pre suspend action required
modprobe -r psmouse

If you are like me you find yourself cloning a repo, making some proposed changes and then deciding to later contributing back using the GitHub Flow convention. Below is a set of instructions I've developed for myself on how to deal with this scenario and an explanation of why it matters based on jagregory's gist.

To follow GitHub flow you should really have created a fork initially as a public representation of the forked repository and the clone that instead. My understanding is that the typical setup would have your local repository pointing to your fork as origin and the original forked repository as upstream so that you can use these keywords in other git commands.

  1. Clone some repo (you've probably already done this step).

Verifying my Blockstack ID is secured with the address 1PbTYssLix5Md7eeKavUv2DW6dMPnBaNhA https://explorer.blockstack.org/address/1PbTYssLix5Md7eeKavUv2DW6dMPnBaNhA
@czekaj
czekaj / inbox-by-google-dark-compact-theme.css
Last active September 17, 2016 20:18
Dark and compact theme for Inbox by Gmail
.lQ {
background: #222 !important;
bottom: 0;
color: #aaa;
line-height: 20px !important;
overflow-x: hidden;
overflow-y: hidden;
padding: 0 0 0 !important;
position: absolute;
white-space: nowrap;