Skip to content

Instantly share code, notes, and snippets.

View bash-history.sh
export HISTSIZE=""
if [ "$PS1" ]; then
bind '"\e[A":history-search-backward'
bind '"\e[B":history-search-forward'
fi
View gist:a5cab8aa5d129a3ba693
if [ $EUID != 0 ]; then
echo "Root privileges required. Trying sudo"
sudo "$0" "$@"
exit $?
fi
yum -y install akmod-nvidia
cat << EOF > /etc/X11/xorg.conf
Section "Device"
Identifier "nvidia"
View switch-headphones.sh
#!/usr/bin/env bash
SINK_SPEAKERS="alsa_output.pci-0000_00_1b.0.analog-stereo"
SINK_HEADPHONES="alsa_output.usb-Logitech_Logitech_G930_Headset-00-Headset.analog-stereo"
pacmd stat | grep "Default sink name" | grep --quiet "$SINK_SPEAKERS"
if [ $? == 0 ]
then
pacmd set-default-sink "$SINK_HEADPHONES" \
@nclundsten
nclundsten / f14post
Created Feb 18, 2011
f14 post install goodies
View f14post
su -c 'yum install yum-plugin-fastestmirror'
su -c 'echo "$USERNAME ALL=(ALL) ALL" >> /etc/sudoers'
echo rpm fusion
yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
echo ===========================================
echo few goodies
sudo yum install wget mplayer htop nano
View gist:3784933
public function indexAction()
{
$checkoutService = $this->getServiceLocator()->get('SpeckCheckout\Service\Checkout');
$options = $checkoutService->getOptions();
$paymentMethods = $options->getPaymentMethods();
$methodForm = new \Zend\Form\Form;
foreach ($paymentMethods as $i) {
$valueOptions[$i->getPaymentMethod()] = $i->getDisplayName();
}
@nclundsten
nclundsten / ssh-key-instruct.md
Last active Oct 14, 2015
add ssh key to ibm-i (or others)
View ssh-key-instruct.md

ssh to the server to set everything up

ssh USERNAME@server.tld

set up home directory

mkdir /home/USERNAME

chown USERNAME /home/USERNAME

View gist:c74cf7383befda8f0500
index 9c31b84..6376a42 100644
--- a/module/RegisterInvite/src/Service/RegisterInviteService.php
+++ b/module/RegisterInvite/src/Service/RegisterInviteService.php
@@ -15,21 +15,16 @@ class RegisterInviteService
throw new RegisterException('no invite');
}
- return $this->getServiceLocator()->get('zfcuser_register_form');
+ $form = $this->getServiceLocator()->get('zfcuser_register_form');
+ $form->get('user_id')->setValue($tokenInfo['generic_id']);
View gist:5067757
<?php
namespace SpeckAddress\Form;
use Zend\Form\Form;
class Address extends Form
{
public function __construct()
{
View gist:5104483
(nlundsten@localhost)$ ./composer.phar install
Loading composer repositories with package information
Installing dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Conclusion: don't install speckcommerce/speck-catalog dev-master
- Conclusion: don't install speckcommerce/speck-address dev-master
- Conclusion: don't install zf-commons/zfc-base 0.1.0
- Conclusion: don't install zf-commons/zfc-base 0.1.0
View gist:5104477
{
"name": "speckcommerce",
"description": "Open Source E-Commerce Platform. PHP, Zend Framework 2, ZF2 Modules",
"minimum-stability": "dev",
"authors": [
{
"name": "SpeckCommerce Authors",
"email": "author@speckcommerce.org"
}
],