Skip to content

Instantly share code, notes, and snippets.

@pavgup
pavgup / gist:9507202f4aa133901d1f
Last active December 21, 2015 15:55
count files recursively in directories and sort results
find . -maxdepth 3 -noleaf -type d -exec sh -c "ls -ltaR \"{}\" | wc -l | tr \"\n\" \" \" && echo \"{}\"" \; | sort -n
# or more simply without a sort:
find . -type d -maxdepth 1 -print0 -exec sh -c 'find "{}" -type f | wc -l' \;
@pavgup
pavgup / 0-gists-are-sorted-alphabetically-hackityhack.md
Last active December 14, 2015 01:19
GCC 4.8 Compiles on OS X 10.11.1 with XCode 7.1 (7B91b); Availability.h has a couple obvious bugs (sigh.) BUT FIXED!

README FIRST; or. tl;dr: copy the file below to /usr/local/include and rebrew.

October 24, 2015: Being slightly bitter about Apple oversights into their seemingly thoughtful approaches and finding zero solutions in my fully updated OS X 10.1 (El Capitan!) macbook, I stopped waiting. This problem was easy enough; small oversight and lines 228 and 250 are modified to keep things moving on OS X. To be fair these fixes may also apply to the blocks for tvOS, watchos, ios, etc. The solution to this kind of stuff is to simply test these headers before pushing them out to the public.

@pavgup
pavgup / agent.cmd
Created October 24, 2015 01:53 — forked from Shoozza/agent.cmd
Make Cmder work with ssh-agent
@ECHO OFF
REM Set default sock file
SET SSH_AUTH_SOCK=/tmp/ssh-agent.sock
REM Check socket is available
IF NOT EXIST "%TMP%\ssh-agent.sock" GOTO:RUNAGENT
REM Check if an ssh-agent is running
FOR /f "tokens=*" %%I IN ('ps ^| grep ssh-agent ^| sed "s/^ *\([0-9]\+\) .*/\1/"') DO SET VAR=%%I
package gov.epa.ctstestapi.service;
import com.codahale.metrics.annotation.Timed;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableListMultimap;
import com.google.common.collect.ImmutableSet;
import java.io.IOException;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
import org.slf4j.Logger;
@pavgup
pavgup / TEST-identifiers.java
Created October 5, 2015 01:22
quick list of TEST endpoints
aBrandNewMolecule.add("SMILES",smiles);
aBrandNewMolecule.add("InChI",igf.getInChIGenerator(molecule).getInchi());
aBrandNewMolecule.add("MOL",swriter.toString());
aBrandNewMolecule.add("MDLV3000",mdlv3000);
aBrandNewMolecule.add("MDLV2000",mdlv2000);
aBrandNewMolecule.add("SDF",sdf);
@pavgup
pavgup / monitor_temps_on_wrt1900ac.sh
Created September 30, 2015 08:17
a simple strategy to get temperature sensor data and fan status from a wrt1900ac router over stdout
#!/bin/sh
while true;
do
cputemp=$(($(cat /sys/class/hwmon/hwmon2/temp1_input)/1000));
ddrtemp=$(($(cat /sys/class/hwmon/hwmon1/temp1_input)/1000));
wifitemp=$(($(cat /sys/class/hwmon/hwmon1/temp2_input)/1000));
date=$(date +"%H:%M:%S");
fan_val=$(cat /sys/devices/pwm_fan/hwmon/hwmon0/pwm1);
echo $date cputemp=$cputemp" "ddrtemp=$ddrtemp" "wifitemp=$wifitemp fanstatus=$fan_val;
sleep 1;
@pavgup
pavgup / tears.log
Created September 21, 2015 13:35
boohoo
/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:62396,suspend=y,server=n -Dfile.encoding=UTF-8 -classpath "/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/ant-javafx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/dt.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/javafx-mx.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/jconsole.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/packager.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/sa-jdi.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/lib/tools.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/deploy.jar:/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre/lib/javaws.jar:/Library/Java/JavaVirtualMach
@pavgup
pavgup / idea.vmoptions
Last active November 18, 2015 21:24 — forked from P7h/IntelliJ_IDEA__Perf_Tuning.txt
Performance tuning parameters for IntelliJ IDEA. Add these params in idea64.exe.vmoptions or idea.exe.vmoptions file in IntelliJ IDEA. If you are using JDK 8.x, please knock off PermSize and MaxPermSize parameters from the tuning configuration.
-server
-Xms2G
-Xmx4G
-XX:NewSize=512m
-XX:MaxNewSize=512m
-XX:PermSize=512m
-XX:MaxPermSize=512m
-XX:+UseParNewGC
-XX:ParallelGCThreads=4
-XX:MaxTenuringThreshold=1
@pavgup
pavgup / README.md
Created September 14, 2015 14:31
quick install instructions for test/epi-suite

README for ctsapi

Getting us running on Windows

  1. Install Java from the Oracle website.
  2. Install Maven (recommended). If you prefer to use Gradle instead, don't install it, as JHipster ships with the Gradle Wrapper.
  3. Install Git from git-scm.com. We recommend you also use a tool like SourceTree if you are starting with Git.
  4. Install Node.js from the Node.js website. This will also install npm, which is the node package manager we are using in the next commands.
@pavgup
pavgup / .gitconfig
Created August 26, 2015 15:36
An attempt at a comfortable .gitconfig
[user]
name = Pavan Gupta
email = [email protected]
[core]
editor = vi
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes