This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ $# -eq 0 ] | |
then | |
echo "Usage: solve.sh windows-style-raw-file-with-path [focal length] [pixel size]" | |
echo | |
echo 'e.g: ./solve.sh "C:\Users\astroman\Pictures\digiCamControl\crescent nebula\DSC_0027.nef"' | |
echo | |
echo "Converts NEF to small jpeg using nconvert (XnView), plate-solves it using the great 'All Sky Plate Solver' (http://www.astrogb.com/astrogb/All_Sky_Plate_Solver.html), and showing the position and rotation of the sensor in stellarium using the remote control plugin. (http://stellarium.org/doc/0.15/remoteControlDoc.html)" | |
echo "By Shlomi Vaknin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check java version | |
JAVA_VER=$(java -version 2>&1 | sed 's/java version "\(.*\)\.\(.*\)\..*"/\1\2/; 1q') | |
if [ "$JAVA_VER" -lt 18 ] | |
then | |
echo "Getting add-apt-repository" | |
wget --no-check-certificate --no-cookies "https://blog.anantshri.info/content/uploads/2010/09/add-apt-repository.sh.txt" -O add-apt-repository.sh | |
echo "Adding oracle java ppa" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def cps (map (fn[[a x]] (.displayName x)) (java.nio.charset.Charset/availableCharsets))) | |
(def s (slurp "test.txt")) | |
(time (with-open [w (io/writer "all-codes1")] | |
(doseq [f cps | |
t cps] | |
(try | |
(.write w (str f "->" t)) | |
(.write w (String. (.getBytes s f) t)) | |
(.write w "\n\n") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import os | |
def kmi_props_setattr(kmi_props, attr, value): | |
try: | |
setattr(kmi_props, attr, value) | |
except AttributeError: | |
print("Warning: property '%s' not found in keymap item '%s'" % | |
(attr, kmi_props.__class__.__name__)) | |
except Exception as e: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: Shlomi Vaknin | |
# Install perf with java flamegraphs on amazon ec2 instances | |
# let yarn using be able to sudo | |
sudo -s | |
echo "yarn ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
# install required packages |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: Shlomi Vaknin | |
# Automatically build and install perf for ubuntu linux kernels. | |
# Useful if your kernel version does not have the required pacakages (linux-tools and linux-cloud-tools) available on ppa, | |
SCRIPT=$(readlink -f "$0") | |
BASEDIR=$(dirname "$SCRIPT") | |
echo "Automatic perf build and install script. \n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> defaults read com.apple.spaces | |
{ | |
SpacesDisplayConfiguration = { | |
"Management Data" = { | |
"Management Mode" = 1; | |
Monitors = ( | |
{ | |
"Current Space" = { | |
id64 = 4; | |
type = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Split an rdd according to its partition number | |
def splitByPartition[T:ClassTag](rdd: RDD[T], hotPartitions:Int): (RDD[T], RDD[T]) = { | |
val splits = rdd.mapPartitions { iter => | |
val partId = TaskContext.get.partitionId | |
val left = if (partId < hotPartitions) iter else empty | |
val right = if (partId >= hotPartitions) iter else empty | |
Seq(left, right).iterator | |
} | |
val left = splits.mapPartitions { iter => iter.next().toIterator} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Count SLOC | |
export SLF=`mktemp -t cljslocXXXX`; find src test -name "*.clj" | xargs egrep -v "(^[[:space:]]*$|^[[:space:]]*;)" | cut -d: -f1 > $SLF && echo "Files"; uniq -c $SLF; echo "Total" `cat $SLF | wc -l`; rm $SLF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn mapper-map [this ^Text key ^ArchiveReader warc-value ^MapContext context] | |
(let [i (.iterator warc-value)] | |
(loop [] | |
(when (.hasNext i) | |
(let [^ArchiveRecord l (.next i)] | |
(println "got " (.available l)) | |
(recur))))) |
NewerOlder