Skip to content

Instantly share code, notes, and snippets.

Joey Smith tml

Block or report user

Report or block tml

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View 1-Oak SegmentNotFoundException repair scenario.md

The objective here is to find all SegmentNotFoundException type corruption and remove it (as we don't have a valid backup)

Before running any of the below steps we created an index.json file (see the file below) which contains only the index definitions of the corrupted indexes.

  1. This generates the file indexing-results\index-definities.json
java -Xmx8g -jar oak-run-1.8.12.jar index --fds-path=crx-quickstart\repository\datastore crx-quickstart\repository\segmentstore --index-definitions
  1. From that file we copied only the definitions we needed and created index.json (file attached here )
View gist:e467515f8814fdc59de7511e836205ae
# Contributor: Joey Smith <joeysmith@gmail.com>
# Maintainer:
pkgname=flif
pkgver=0.3
pkgrel=0
pkgdesc="FLIF is a lossless image format which outperforms PNG, lossless WebP, lossless BPG, lossless JPEG2000, and lossless JPEG XR."
url="https://flif.info"
arch="all"
license="LGPLv3+"
depends="libpng"
@tml
tml / checkBlobs.groovy
Last active Feb 5, 2019
checkBlobs.groovy
View checkBlobs.groovy
import ch.qos.logback.classic.Level
import com.google.common.base.Stopwatch
import org.apache.jackrabbit.oak.api.Blob
import org.apache.jackrabbit.oak.api.PropertyState
import org.apache.jackrabbit.oak.api.Type
import org.apache.jackrabbit.oak.commons.PathUtils
import org.apache.jackrabbit.oak.spi.state.ChildNodeEntry
import org.apache.jackrabbit.oak.spi.state.NodeState
import org.apache.jackrabbit.oak.spi.state.NodeStateUtils
import org.apache.jackrabbit.oak.spi.state.NodeStore
View gist:5fac802de028b8e8024ebf95902b9951
root@ip-172-31-19-81:~# cat >> .bash_profile <<EOT
> echo "I ran the .bash_profile for root"
> EOT
root@ip-172-31-19-81:~# logout
(main) 23:33:16 [ joey@ip-172-31-19-81:0 ] ~ 2126 -->sudo -s
23:33:20 [ root@ip-172-31-19-81:0 ] ~ 494 -->exit
(main) 23:33:21 [ joey@ip-172-31-19-81:0 ] ~ 2127 -->sudo -i
I ran the .bash_profile for root
View path-debugger.php
<?php
$path = '';
foreach(array_filter(explode('/', '/var/run/memcached/memcached.socket')) as $p) {
$path .= '/'.$p;
if (file_exists($path)) {
echo "{ '$path' : ", json_encode(stat($path)), "} \n";
} else {
echo "PHP cannot see $path.\n";
exit(1);
}
View u_filter.py
def u_filter(func, iterable):
if f is None:
return (item for item in iterable if item)
return (item for item in iterable if func(item))
View gist:fb4b8ac960f66eddbb12dd97d2626402
https://blogs.msdn.microsoft.com/scottdensmore/2004/05/25/why-singletons-are-evil/
http://steve.yegge.googlepages.com/singleton-considered-stupid
http://googletesting.blogspot.com/2008/11/clean-code-talks-global-state-and.html
https://www.alainschlesser.com/singletons-shared-instances/
http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/
View gettext example
locale/en/LC_MESSAGES:
-rw-rw-r-- 1 joey joey 67 May 20 10:38 template.mo
-rw-rw-r-- 1 joey joey 28 May 20 10:37 template.po
template.po:
msgid "foo"
msgstr "foobar"
locale/it/LC_MESSAGES:
View summit-lab-notes
This is the gist used for the Adobe Summit labs
ex1 https://www.youtube.com/watch?v=mIlI2T_GXM8&feature=youtu.be
ex2 https://www.youtube.com/watch?v=TtP71cZ3zBo&feature=youtu.be
ex3 https://www.youtube.com/watch?v=Cemp0J34LTM&feature=youtu.be
View gist:c17962c716e6f5d007ac1c7939ba93db
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libutil.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libexpat.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libz.so.1", O_RDONLY|O_CLOEXEC) = 3
open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/locale/locale-archive", O_RDONLY|O_CLOEXEC) = 3
open("/usr/lib/x86_64-linux-gnu/gconv/gconv-modules.cache", O_RDONLY) = 3
You can’t perform that action at this time.