Skip to content

Instantly share code, notes, and snippets.

@nekulin
nekulin / convert id_rsa to pem
Created November 4, 2020 17:36 — forked from mingfang/convert id_rsa to pem
Convert id_rsa to pem file
openssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem
chmod 600 id_rsa.pem
@nekulin
nekulin / rabbitmq.txt
Created March 13, 2018 08:54 — forked from sdieunidou/rabbitmq.txt
create admin user on rabbitmq
rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
@nekulin
nekulin / usb-modeswitch-huawei-e303-debian-jessie-lite-raspberry.md
Created October 13, 2017 09:22 — forked from plieningerweb/usb-modeswitch-huawei-e303-debian-jessie-lite-raspberry.md
Debug USB-Modeswitch (Raspberry with debian jessi lite) and Huawei E303

test if modeswitch works

$ sudo usb_modeswitch -v 0x12d1 -p 0x1f01 -M "55534243123456780000000000000a11062000000000000100000000000000"

if yes than usually you would do this (but for me it did not work)

#edit config file
/etc/usb_modeswitch.conf
@nekulin
nekulin / launch-grid.sh
Created December 10, 2016 18:40 — forked from revington/launch-grid.sh
launch selenium grid + phantomjs
#!/usr/bin/env sh
trap 'killall' INT
killall() {
trap '' INT TERM # ignore INT and TERM while shutting down
echo "**** Shutting down... ****" # added double quotes
kill -TERM 0 # fixed order, send TERM not INT
wait
echo DONE
}
@nekulin
nekulin / setup_selenium.sh
Created January 10, 2016 06:18 — forked from curtismcmullan/setup_selenium.sh
Setup Selenium Server on Ubuntu 14.04
#!/bin/bash
# Following the guide found at this page
# http://programmingarehard.com/2014/03/17/behat-and-selenium-in-vagrant.html
echo "\r\nUpdating system ...\r\n"
sudo apt-get update
# Create folder to place selenium in
<?php
$this->imgMetadata['format'] = strtolower($this->imagickObj->getImageFormat());
$this->imgMetadata['width'] = $this->imagickObj->getImageWidth();
$this->imgMetadata['height'] = $this->imagickObj->getImageHeight();
$x = $y = 0;
switch ($gravity) {
case 'center':
// $gravity = \Imagick::GRAVITY_CENTER;
$x = ($this->imgMetadata['width']/2) - ($width/2);