Skip to content

Instantly share code, notes, and snippets.

View dossy's full-sized avatar
🍪
derping around

Dossy Shiobara dossy

🍪
derping around
View GitHub Profile
@dossy
dossy / git.md
Last active January 9, 2016 21:30
Handy git tricks

Handy Git Tricks

Get branches, sorted by last commit

Local:

$ git for-each-ref --sort=-committerdate --format='%(committerdate:iso8601)  %(objectname:short)  %(refname)' refs/heads
@dossy
dossy / patch_inotify_init1.c
Created November 27, 2015 18:43
Running CrashPlan on older Linux
/*
* $ gcc -Wall -shared -fPIC -o patch_inotify_init1.so patch_inotify_init1.c
*
* LD_PRELOAD=patch_inotify_init1.so java ...
*
* [11.27.15 12:43:37.040 ERROR main .service.backup.BackupController] Exception setting up BackupController! , java.lang.UnsatisfiedLinkError: Error looking up function 'inotify_init1': /usr/local/crashplan/jre/bin/java: undefined symbol: inotify_init1
* STACKTRACE:: java.lang.UnsatisfiedLinkError: Error looking up function 'inotify_init1': /usr/local/crashplan/jre/bin/java: undefined symbol: inotify_init1
* at com.sun.jna.Function.<init>(Function.java:208)
* at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:536)
* at com.sun.jna.NativeLibrary.getFunction(NativeLibrary.java:513)
alter table wp_posts drop index yarpp_content;
alter table wp_posts modify post_content longtext character set latin1;
alter table wp_posts modify post_content longtext character set binary;
alter table wp_posts modify post_content longtext character set utf8mb4 collate utf8mb4_unicode_ci;
alter table wp_posts default character set utf8mb4 collate utf8mb4_unicode_ci;
alter table wp_posts add fulltext index yarpp_content (post_content);
@dossy
dossy / ntpdate.plist
Created July 5, 2017 15:11
/Library/LaunchDaemon/ntpdate.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>ntpdate</string>
<key>Disabled</key>
<false/>
<key>UserName</key>
<string>root</string>
@dossy
dossy / xml.go
Last active March 16, 2018 11:18
General-purpose XML parsing in Go
/*
https://play.golang.org/p/3g50cX2ed-
Output looks like:
&main.Node{XMLName:xml.Name{Space:"", Local:"foo"}, Comments:" a b ", Attrs:[]xml.Attr(nil), Value:"", Children:[]main.Node{main.Node{XMLName:xml.Name{Space:"", Local:"bar"}, Comments:"", Attrs:[]xml.Attr{xml.Attr{Name:xml.Name{Space:"", Local:"baz"}, Value:"bing"}}, Value:"", Children:[]main.Node(nil)}}}
*/
package main
@dossy
dossy / gawk-split-mysqldump.sh
Last active June 25, 2018 15:46
split mysqldump with gawk
gawk 'BEGIN { F="_"; } match($0, /^-- (Table|Temporary table) structure for (table|view) `(.*)`/, m) { close(F ".sql"); F=m[3]; } { print $0 > F ".sql"; }'
@dossy
dossy / aws-snapshot-backup.sh
Created December 31, 2015 03:37
Create snapshots of current EC2 instance's volumes.
#!/bin/bash
if [ -z "$AWS_CREDENTIALS" ]; then
AWS_CREDENTIALS="$HOME/.aws/credentials"
fi
if [ ! -e "$AWS_CREDENTIALS" ]; then
echo "$AWS_CREDENTIALS missing; use 'aws configure'."
exit
fi
@dossy
dossy / ipmitool-1.8.11-99.dell.patch
Created May 30, 2012 20:26
Dell patches to ipmitool-1.8.11 from Redhat SRPM
This file has been truncated, but you can view the full file.
The following patch is a combination of the Dell contributions to ipmitool, taken from the following Dell tarball for the corresponding RPM:
http://opensource.dell.com/releases/BMU/ipmitool-1.8.11-99.dell.tar.bz2
This patch was generated by diff'ing the upstream ipmitool-1.8.11 source against the ipmitool-1.8.11-99.dell source, with the following command:
% diff -urN -x .git -x autom4te.cache -x Makefile -x config.h -x config.log -x config.status -x '*.keep' -x .deps -x '*.spec' ipmitool-1.8.11 ipmitool-1.8.11-99.dell > ipmitool-1.8.11-99.dell.patch
Release Notes.txt | 9
ipmitool-1.8.11-99.dell/CHANGES.txt | 8
@dossy
dossy / keybase.md
Created December 14, 2019 16:26
Keybase proof

Keybase proof

I hereby claim:

  • I am dossy on github.
  • I am dossy (https://keybase.io/dossy) on keybase.
  • I have a public key whose fingerprint is C535 6302 1171 987D 738E BFD8 2B1A B2E1 8D97 40AA

To claim this, I am signing this object:

@dossy
dossy / main.dart
Created December 18, 2020 17:17
Dart List<NetworkImage> example
// for: https://stackoverflow.com/questions/65272176/how-to-solve-type-listdynamic-is-not-a-subtype-of-type-string
import 'package:flutter/material.dart';
import 'package:flutter/painting.dart';
final Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}