Skip to content

Instantly share code, notes, and snippets.

View rofr's full-sized avatar

Robert Friberg rofr

View GitHub Profile
@rofr
rofr / gist:b7032c120bdfbb93a2bd787aac67379e
Created March 17, 2017 20:57
when your password is too weak and you are using java
/Applications/fmw_12.2.1.2.0_wls_quick_Disk1_1of1/mydomain$ java weblogic.Server
<Mar 17, 2017 9:14:58 PM CET> <Info> <Security> <BEA-090905> <Disabling the CryptoJ JCE Provider self-integrity check for better startup performance. To enable this check, specify -Dweblogic.security.allowCryptoJDefaultJCEVerification=true.>
<Mar 17, 2017 9:14:58 PM CET> <Info> <Security> <BEA-090906> <Changing the default Random Number Generator in RSA CryptoJ from ECDRBG128 to HMACDRBG. To disable this change, specify -Dweblogic.security.allowCryptoJDefaultPRNG=true.>
<Mar 17, 2017 9:14:59 PM CET> <Info> <WebLogicServer> <BEA-000377> <Starting WebLogic Server with Java HotSpot(TM) 64-Bit Server VM Version 25.102-b14 from Oracle Corporation.>
/Applications/fmw_12.2.1.2.0_wls_quick_Disk1_1of1/mydomain/config not found
No config.xml was found.
Would you like the server to create a default configuration and boot? (y/n): y
<Mar 17, 2017 9:15:03 PM CET> <Info> <Management> <BEA-140013> </Applications/fmw_12.2.1.2.0_wls_quick_Dis
@rofr
rofr / ControllerMethods.cs
Created December 21, 2016 11:37
MVC Razor view with jQuery AJAX calling MVC controller method
public class HomeController : Controller
{
public ActionResult Math()
{
return View("Math");
}
public ActionResult Add(int a, int b)
{
int sum = a + b;
public class TextLiteral
{
[EdifactElement(0)]
public string Line0 { get; set; }
[EdifactElement(1, required: false)]
public string Line1 { get; set; }
[EdifactElement(2, required: false)]
public string Line2 { get; set; }
@rofr
rofr / output
Last active November 2, 2016 11:51
Amazon VPC, security group and SSH access
-- partial output of terraform show
public_dns = ec2-52-91-147-187.compute-1.amazonaws.com
public_ip = 52.91.147.187
root_block_device.# = 1
root_block_device.0.delete_on_termination = true
root_block_device.0.iops = 100
root_block_device.0.volume_size = 10
root_block_device.0.volume_type = gp2
security_groups.# = 0
source_dest_check = true
package kata.bowling;
import static org.junit.Assert.*;
import org.junit.Before;
import org.junit.Test;
public class BowlingTests {
@rofr
rofr / rubik_arduino.c
Created March 2, 2016 00:20
Rubik: Arduino sketch updated with acceleration curves
/*
* Full-step = 1, Half-step = 2, Quarter = 4, Eighth = 8, Sixteenth = 16
*/
const int STEP_FACTOR = 8;
/*
* pins to select stepfactor
*/
const int MS1 = 52;
const int MS2 = 50;
@rofr
rofr / rubik_arduino.c
Created February 29, 2016 13:06
Rubik: Arduino sketch testing a single stepper motor
/*
* Delay between high/low pulses to the motors.
* A 90 degree rotation with a 10 millisecond delay will take 1 second.
*/
const int STEPDELAY_MICROS = 1500;
/*
* Motors 0-5 are represented by the letters for the faces of the cube.
* Up, Face, Right, Back, Left, Down
*/
@rofr
rofr / origo-redis-bitsettests.cs
Created January 25, 2016 11:18
Is using a Random seed in unit tests a good idea?
[Test]
public void Length()
{
const string key = "a";
const int limit = 100000;
//seed is random but included in output if test fails
var seed = new Random().Next();
var r = new Random(seed);
int max = 0;
/*
drop table Shape;
drop table Drawing;
drop table ShapeType;
*/
create table Drawing (
DrawingId int not null primary key,
Name varchar(100)
@rofr
rofr / transcript.txt
Created September 7, 2015 14:43
redis - the machine language of databases
INCR next_user_id //returns 1000
HMSET user:1000 name bart password ¤¤¤hash¤¤¤
HSET users bart 1000
ZADD followers:1000 1401267618 1234
ZADD following:1234 1401267618 1000
INCR next_post_id => 10343
HMSET post:10343 user 1000 time $time body ’Ay Caramba’
RPUSH posts:1000 10343