Skip to content

Instantly share code, notes, and snippets.

[root@arrakis ~]# pvs
WARNING: Device for PV dVnU1B-VVHh-sfVx-rdly-AXhi-45TO-FBp9WG not found or rejected by a filter.
WARNING: Device for PV dVnU1B-VVHh-sfVx-rdly-AXhi-45TO-FBp9WG not found or rejected by a filter.
PV VG Fmt Attr PSize PFree
[unknown] fourbak01 lvm2 a-m <3.64t 1.78t
[root@arrakis ~]# lvs
WARNING: Device for PV dVnU1B-VVHh-sfVx-rdly-AXhi-45TO-FBp9WG not found or rejected by a filter.
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
games fourbak01 -wi-----p- 250.00g
@apocalyptech
apocalyptech / hib.py
Created December 20, 2017 17:43
Humble Indie Bundle release statistics
#!/usr/bin/env python
# vim: set expandtab tabstop=4 shiftwidth=4:
import datetime
import statistics
###
### 'statistics' is only available starting in Python 3.4, btw
###
@apocalyptech
apocalyptech / loot.txt
Created January 22, 2018 06:28
Attempting to play around with Borderlands 2 loot rarity probabilities (without success)
set GD_Itempools.WeaponPools.Pool_Weapons_All BalancedItems ((ItmPoolDefinition=ItemPoolDefinition'GD_Itempools.WeaponPools.Pool_Weapons_All_01_Common',InvBalanceDefinition=None,Probability=(BaseValueConstant=0.000000,BaseValueAttribute=None,InitializationDefinition=AttributeInitializationDefinition'GD_Balance.Weighting.Weight_1_Common_RareMod',BaseValueScaleConstant=0.000000),bDropOnDeath=True),(ItmPoolDefinition=ItemPoolDefinition'GD_Itempools.WeaponPools.Pool_Weapons_All_02_Uncommon',InvBalanceDefinition=None,Probability=(BaseValueConstant=0.000000,BaseValueAttribute=None,InitializationDefinition=AttributeInitializationDefinition'GD_Balance.Weighting.Weight_2_Uncommon',BaseValueScaleConstant=0.000000),bDropOnDeath=True),(ItmPoolDefinition=ItemPoolDefinition'GD_Itempools.WeaponPools.Pool_Weapons_All_04_Rare',InvBalanceDefinition=None,Probability=(BaseValueConstant=0.000000,BaseValueAttribute=None,InitializationDefinition=AttributeInitializationDefinition'GD_Balance.Weighting.Weight_4_Rare',BaseValueScaleCon
set GD_Orchid_ItemPools.Raid.PoolList_Orchid_Raid3_Items ItemPools ((ItemPool=ItemPoolDefinition'GD_Orchid_ItemPools.Raid.Pool_Orchid_Raid3_PinkWeapons',PoolProbability=(BaseValueConstant=1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(ItemPool=ItemPoolDefinition'GD_Orchid_ItemPools.Raid.Pool_Orchid_Raid3_Legendary',PoolProbability=(BaseValueConstant=1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(ItemPool=ItemPoolDefinition'GD_Itempools.EnemyDropPools.Pool_GunsAndGear_05_VeryRare',PoolProbability=(BaseValueConstant=1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(ItemPool=ItemPoolDefinition'GD_Itempools.EnemyDropPools.Pool_GunsAndGear_05_VeryRare',PoolProbability=(BaseValueConstant=1.000000,BaseValueAttribute=None,InitializationDefinition=None,BaseValueScaleConstant=1.000000)),(ItemPool=ItemPoolDefinition'GD_Itempools.EnemyDropPools.Pool_GunsAndGear_05_VeryRare'
#<Aegrus Not-So-Rare Monsters>
#<Adjust Rare Monster Spawn Rates><MUT>
#<Normalized Spawn Rate>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareBorok1"</key><value>",GD_Sage_Pop_Rhino.Population.PopDef_RhinoMix_Regular,ActorArchetypeList[4].Probability.BaseValueConstant,,1"</value><on>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareDrifter1"</key><value>",GD_Sage_Pop_Drifter.Population.PopDef_Drifter,ActorArchetypeList[1].Probability.BaseValueConstant,,1"</value><on>
#<Aegrus Not-So-Rare Monsters>
#<Adjust Rare Monster Spawn Rates><MUT>
#<Normalized Spawn Rate>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareBorok1"</key><value>",GD_Sage_Pop_Rhino.Population.PopDef_RhinoMix_Regular,ActorArchetypeList[4].Probability.BaseValueConstant,,1"</value><on>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareDrifter1"</key><value>",GD_Sage_Pop_Drifter.Population.PopDef_Drifter,ActorArchetypeList[1].Probability.BaseValueConstant,,1"</value><on>
#<Adjust Rare Monster Spawn Rates><MUT>
#<Normalized Spawn Rate>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareBorok1"</key><value>",GD_Sage_Pop_Rhino.Population.PopDef_RhinoMix_Regular,ActorArchetypeList[4].Probability.BaseValueConstant,,0.9"</value><on>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareDrifter1"</key><value>",GD_Sage_Pop_Drifter.Population.PopDef_Drifter,ActorArchetypeList[1].Probability.BaseValueConstant,,0.4"</value><on>
#<hotfix><key>"SparkLevelPatchEntry-HammerlockRareScaylion1"</key><value>",GD_Sage_Pop_Scaylion.Population.PopDef_Sage_ScaylionMix_Regular,ActorArchetypeList[6].Probability.BaseValueConstant,,1.0"</value><on>
Intervals found: 18 (HIBs: 19)
224, 224, 140, 170, 110, 92, 160, 106, 118, 42, 203, 39, 165, 181, 147, 175, 273, 315
Arithmetic mean: 160 days (5.3 months)
Standard deviation: 72 days (2.4 months)
Maximum HIB interval (between 18 and 19): 315 days (10.5 months)
Current HIB interval, if released today: 0 days (0.0 months)
Next HIB, if exactly at mean: September 03, 2018
@apocalyptech
apocalyptech / HighlightedTextArea.java
Created April 18, 2018 03:27
Problem with text formatting in JTextPane/DefaultStyledDocument using setCharacterAttributes()
package testing;
import testing.ObjectExplorer;
import java.awt.Font;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;
import java.util.logging.Level;
RarityLevelColors(0)=(MinLevel=0,MaxLevel=0,Color=(B=175,G=193,R=205,A=0),DropLifeSpanType=DROP_ShortLived,RarityRating=RARITY_Unknown)
RarityLevelColors(1)=(MinLevel=1,MaxLevel=1,Color=(B=255,G=255,R=255,A=255),DropLifeSpanType=DROP_ShortLived,RarityRating=RARITY_Common)
RarityLevelColors(2)=(MinLevel=2,MaxLevel=2,Color=(B=11,G=210,R=61,A=255),DropLifeSpanType=DROP_LongLived,RarityRating=RARITY_Uncommon)
RarityLevelColors(3)=(MinLevel=3,MaxLevel=3,Color=(B=255,G=142,R=60,A=255),DropLifeSpanType=DROP_LiveForever,RarityRating=RARITY_Rare)
RarityLevelColors(4)=(MinLevel=4,MaxLevel=4,Color=(B=229,G=63,R=168,A=255),DropLifeSpanType=DROP_LiveForever,RarityRating=RARITY_VeryRare)
RarityLevelColors(5)=(MinLevel=5,MaxLevel=5,Color=(B=0,G=180,R=255,A=255),DropLifeSpanType=DROP_LiveForever,RarityRating=RARITY_Legendary)
RarityLevelColors(6)=(MinLevel=6,MaxLevel=6,Color=(B=168,G=0,R=202,A=255),DropLifeSpanType=DROP_LiveForever,RarityRating=RARITY_VeryRare)
RarityLevelColors(7)=(MinLevel=7,MaxLevel=10,Col