Skip to content

Instantly share code, notes, and snippets.

View pol's full-sized avatar

pol llovet pol

View GitHub Profile
it "should have acts_as_list functionality" do
@sec1 = sections(:teaching)
@sec2 = sections(:scholarship)
@sec1.should be_in_list
@sec2.should be_in_list
(@sec1.position < @sec2.position).should be_true
@sec2.move_higher
(@sec1.position > @sec2.position).should be_true
end
- name: add lines in sources.list file
lineinfile: dest=/etc/apt/sources.list.d/zabbix.list line={{item}} create=yes
with_items:
- deb http://repo.zabbix.com/zabbix/2.2/debian squeeze main
- deb-src http://repo.zabbix.com/zabbix/2.2/debian squeeze main
register: zabbix_sources_list
- name: grab the zabbix gpg key for the sources
shell: gpg -q -y --keyserver subkeys.pgp.net --recv-keys D13D58E479EA5ED4;
gpg -a --export D13D58E479EA5ED4 | sudo apt-key add -
@pol
pol / common-account
Last active August 29, 2015 13:58
MSU RCG SMB/LDAP conf files
#
# /etc/pam.d/common-account - authorization settings common to all services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authorization modules that define
# the central access policy for use on the system. The default is to
# only deny service to users whose accounts are expired in /etc/shadow.
#
# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
# To take advantage of this, it is recommended that you configure any
@pol
pol / ansible-role
Created July 2, 2014 22:45
ansible-role shell script
#!/bin/sh
if [ $# -lt 1 ]; then
echo "Usage: ansible-role ROLE ARGS...\n(see ansible-playbook --help for args)"
exit 1
fi
ROLE=$1
shift
OPTS=$*

Keybase proof

I hereby claim:

  • I am pol on github.
  • I am pol (https://keybase.io/pol) on keybase.
  • I have a public key whose fingerprint is BA86 97D9 B6BC B583 8DF9 C319 CFE1 BF1A 30F1 E495

To claim this, I am signing this object:

<% form_for @survey do |f| %>
<%= observe_form "edit_survey_#{@survey.id}",
:url => survey_path(@survey),
:method => :put,
:frequency => 5,
:update => 'savedat_time'
%>
<%#= the form... %>
@pol
pol / Readme.md
Created September 23, 2014 17:57
Exercise.io Elixir Exercirse

Bob

Bob is a lackadaisical teenager. In conversation, his responses are very limited.

Bob answers 'Sure.' if you ask him a question.

He answers 'Whoa, chill out!' if you yell at him.

He says 'Fine. Be that way!' if you address him without actually saying anything.

@pol
pol / yum_debugging1.txt
Last active August 29, 2015 14:12
repolist all
[root@hyalite ~]# yum repolist all
Loaded plugins: fastestmirror, priorities, refresh-packagekit
Loading mirror speeds from cached hostfile
* base: mirror.supremebytes.com
* epel: mirror.pnl.gov
* extras: centos.mia.host-engine.com
* updates: mirrors.xmission.com
351 packages excluded due to repository priority protections
repo id repo name status
C6.0-base CentOS-6.0 - Base disabled
<script type="text/javascript">
//<![CDATA[
//haHA This works! It could probably use some refactoring.
$(document).ready(function(){
$(".help_icon").click(function(){
help_icon = $(this);
help_container = help_icon.parent();
help = help_icon.siblings('.help_dialog');
help.css('display','block')
help.dialog({
Write restart file '/mnt/lustrefs/w94w693/output/rcp26/CESM1-CAM5/spinup/restart0.lpj'.
Simulation ended.
/home/zhen.zhang/LPJ/lpj terminated, 4 grid cells processed.
Wall clock time: 118 sec, 0.029 sec/cell/year.
real 1m58.939s
user 0m4.912s
sys 1m53.775s