Body is a 3 dollar ant man figure from Aliexpress
Helmet is hero mashers boba fett
Chest armor is hero mashers boba fett
Cape is made from a Tshirt
Jet pack is hero mashers boba fett
Weapon is from overwatch, I think
I still need to add upper thigh armor
Category Archives: Geek
Star Wars Custom Moisture Vaporator
Finally bit the bullet and used my random stuff to make a moisture vaporator.
Made with random stuff I have been saving… Bottom to top…
* Vitamin lid
* 2 bases from Lord of the Rings Trivial Pursuit
* some random plastic things leftover from ikea builds
* cube made of cardboard
* wwe dumbell
* center twister from anti perspirant
* oj lid
* super glue lid
* Flonase plastic piece
* the spinner on top cut from some trash
* Dollar tree dowels
* Random greeblies added throughout
Painted white, added some oxide red paint for rust, some light brown for dirt, black washed with watered down shoe polish.
This was super fun to make. I highly recommend it.
UPDATE: it was too dirty and weathered so I repainted it.
Cold Brew Recipe
I’ve been making and drinking my own cold brew for a couple years now… here is my tried and true recipe. There are many ways to make code brew and no right or wrong ways… this one is mine…
I brew with this:
but any 64oz container would work.
The coffee I use is either of these:
I like the Comunity coffee with chicory from my days buying Peet’s Cold brew and the Gevalia just has some amazing flavors. I need to try mixing them.
Recipe:
1) put 1.5 cups of coffee into your cold brew. If you’re using a filter/sack/bag, put it in there.
2) wet the coffee a few times in the sack before closing it off (and keep the drippings in the jar).
3) tie off the sack, drop it in the jar then fill the container with water
4) refrigerate it for 24h.
5) next day, just pull out the sack (I squeeze it to get the last bits of coffee out)
Done! Drink it how you like it. I use about 50% code brew with 25% milk and 25% coconut creamer.
100K on last.fm
Today, on April 10, 2015, I crossed the 100,000 mark on last.fm for number of scrobbles. That’s 100K in 10 years, so 10K per year. I listen to music constantly while coding each day, so that’s the biggest contributor. That’s a lot of music. My all time top 3 artists are:
- Pearl Jam
- MC Frontalot
- Death Cab For Cutie
Though in the last year it’s:
- Of Monsters and Men
- Mumford and Sons
- Walk off the Earth
Using Active Directory for authentication in Spring with custom permissions (roles)
Recently at work, I had to work on setting up a Spring application to do Active Directory authentication and use our internal permissions service. After much googling and playing around I finally figured out how to get it all working. I suspect this may not be the best way to do this, but it works.
Set this up in your config XML
1 2 3 4 5 6 7 8 9 10 | <!-- Connect to AD --> <bean id="activeDirectoryAuthenticationProvider" class="org.springframework.security.ldap.authentication.ad.ActiveDirectoryLdapAuthenticationProvider"> <constructor -arg value="YOURDOMAIN"></constructor> <constructor -arg value="ldap://YOURSERVER"></constructor> <property name="userDetailsContextMapper" ref="customDetailsMapper"></property> <property name="convertSubErrorCodesToExceptions" value="true"></property> </bean> <!-- add in your permissions --> <bean id="customDetailsMapper" class="Full path to CustomDetailsMapper class"></bean> |
Now, the CustomDetailsMapper
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | package mypackage; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; import org.apache.log4j.Logger; import org.springframework.ldap.core.DirContextOperations; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.ldap.userdetails.LdapUserDetailsMapper; public class CustomUserDetailsMapper extends LdapUserDetailsMapper { protected static Logger logger = Logger.getLogger("CustomUserDetailsMapper"); private static final Collection<string> DEFAULT_PERMS = Arrays.asList("login"); @Override public UserDetails mapUserFromContext(DirContextOperations ctx, String username, Collection< ? extends GrantedAuthority> authorities) { /** * at this point, the user has permissions based on groups in LDAP/AD. If * we used AD for permissions, this would be sufficient, but we want permissions * from elsewhere so we need to modify the permissions/authorities */ logger.info(" old authorities: "+authorities); UserDetails user = super.mapUserFromContext( ctx, username, getPermissions(username)); logger.info(" adjusted user: "+user); return user; } /** * gets permissions * * @param username the username to get permissions for * @return a Set of permissions for the user */ private Set<grantedauthority> getPermissions(String username) { Set</grantedauthority><grantedauthority> permissions = new HashSet</grantedauthority><grantedauthority>(); /** * get your permissions here - however you need to * then convert them to SimpleGrantedAuthority */ for (String perm : permissionsFromOtherSource) { permissions.add(new SimpleGrantedAuthority(perm)); } return permissions; } } </grantedauthority></string> |
NOTE: the blog’s java code formatter is messing this code up a bit (specifically the GrantedAuthority parts), but you should be able to get the gist of it. Basically, after the user is filled out from AD, we get a handle to it and we change the permissions on it.