Skip to content

Instantly share code, notes, and snippets.

View alpine-kde-installer.sh
#!/bin/sh
# non-interactive kde installer for alpine
# apk add curl && curl -L https://cutt.ly/alpine_kde | sh
echo "I will make Alpine Linux a Desktop Linux.. ."
## Desktop user
@grigio
grigio / bitbucket-pipelines.yml
Created Oct 27, 2017
bitbucket-pipelines.yml
View bitbucket-pipelines.yml
image: node:8
clone:
depth: full
pipelines:
custom:
developmanual:
- step:
script:
- git config --global user.email "you@example.com" && git config --global user.name "Your Name"
- echo "Check if the PR branch is rebased"; git rebase origin/master | grep -v "up to date" && exit 1
View touchpad-fix.desktop
[Desktop Entry]
Type=Application
Terminal=false
Name=Touchpad Fix
Exec=/usr/bin/synclient MinSpeed=1.8 MaxSpeed=4 AccelFactor=0.04 ClickPad=1 VertHysteresis=0.1 HorizHysteresis=0.1 HorizTwoFingerScroll=1 VertScrollDelta=-30 HorizScrollDelta=-30
Icon=libinput-gestures
Comment=synaptic touchpad fix
Categories=GNOME;GTK;System;
View gist:affd79a33444a40b6f933d871e1868c2
# nodemon.json
{
"events": {
"restart": "clear"
}
}
# nodemon --quiet --exec babel-node --stage 0 -- myfile.js
@grigio
grigio / Documentation.md
Created Jan 24, 2016 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)
View Documentation.md

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
View swapfile-enable.sh
sudo fallocate -l 4G /swapfile
sudo mkswap /swapfile
sudo chmod 600 /swapfile
# "UUID" & create
#SWAP_UUID=`sudo blkid -s UUID /swapfile | grep -Po '[\w*-]*\w'| tail -1`
echo "/swapfile none swap sw 0 0" | sudo tee -a /etc/fstab
sudo swapon -a
@grigio
grigio / gist:ecebc97b0ad83c439419
Created Jan 23, 2015
Fucking OSX 10.10 Yosemite errors
View gist:ecebc97b0ad83c439419
Google Chrome He (map: 0xffffff800fb225a0) triggered DYLD shared region unnest for map: 0xffffff800fb225a0, region 0x7fff85400000->0x7fff85600000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
en0: 802.11d country code set to 'IT'.
en0: Supported channels 1 2 3 4 5 6 7 8 9 10 11 12 13 36 40 44 48 52 56 60 64 100 104 108 112 116 120 124 128 132 136 140
memorystatus_thread: idle exiting pid 39 [iconservicesagen]
memorystatus_thread: idle exiting pid 100 [secinitd]
memorystatus_thread: idle exiting pid 99 [ctkd]mac
Google Chrome He (map: 0xffffff800fb22b40) triggered DYLD shared region unnest for map: 0xffffff800fb22b40, region 0x7fff85400000->0x7fff85600000. While not abnormal for debuggers, this increases system memory footprint until the target exits.
memorystatus_thread: idle exiting pid 127 [com.apple.ifdrea]
memorystatus_thread: idle exiting pid 125 [nehelper]
memorystatus_thread: idle exiting pid 133 [sysmond]
View rust_counter_atomics.rs
// Ported to rust 1.0.0-dev
// latest version is https://github.com/grigio/fun-with-threads/blob/master/rust_counter_atomics.rs
use std::sync::Arc;
use std::sync::atomic::AtomicUint;
use std::sync::atomic::Ordering::Relaxed;
use std::sync::mpsc::channel;
use std::thread::Thread;
const NUM_THREADS: usize = 20;
const NUM_INCREMENTS: usize = 10000000us;
View locks.rs
// Ported to Rust 0.13.0-nightly but it doesn't seem to work as expected
use std::time::duration::Duration;
use std::sync::{Arc,RWLock};
use std::thread::Thread;
fn main() {
println!("running channels: ");
channels();
println!("running locks: ");
View config.cson
'editor':
'fontFamily': 'menlo'
'softWrap': true
'showInvisibles': true
'showIndentGuide': true
'fontSize': 14
'core':
'themes': [
'atom-dark-ui'
'darkmate'
You can’t perform that action at this time.