This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In this section, we will create our own learner's NGINX module which can be used to server a couple of websites: | |
`/etc/hosts/nginx/manifests/init.pp` | |
``` | |
class nginx { | |
package { 'nginx': ensure => installed } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
127.0.0.1 localhost nextraining.puppet.sbose.in | |
<% servername.each do |name| -%> | |
127.0.0.1 <%= name['hostname'] %> | |
<% end -%> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ode vagrant-ubuntu-trusty-32 { | |
nginx::vhost::apply{ "web1": | |
domain => "site1.puppet.sbose.in", | |
root => "/home/ubuntu/site1" | |
} | |
nginx::vhost::apply{"web2": | |
domain => "site2.puppet.sbose.in", | |
root => "/home/ubuntu/site2" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# execute 'apt-get update' | |
exec { 'apt-update': # exec resource named 'apt-update' | |
command => '/usr/bin/apt-get update' # command this resource will run | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from work_items where fields @> '{"system.remote_item_id":null}' | |
update work_items set fields = jsonb_set(fields,'{system.remote_item_id}','2',true) where id = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
So what I want to do is to give a configuration object to every controller | |
and the controller can call only specific methods on it. | |
*/ | |
type SuperInterface interface { | |
myfunc() | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir -p converted | |
for filename in /home/shoubhik/raw-photos-doshomi/*.JPG ; do | |
source_file=$filename | |
f=`basename "$filename"` | |
destination="converted/$f" | |
convert -strip -interlace Plane -gaussian-blur 0.05 -quality 35% $source_file $destination | |
echo $destination | |
done | |
~ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
update_version(){ | |
if [[ "$DONT_BUMP_VERSION" -ne "1" ]] | |
then | |
echo " Bumping version.. " | |
else | |
echo "Version will not be bumped since variable DONT_BUMP_VERSION is set." | |
exit 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select * from work_items where | |
setweight(to_tsvector('english',fields->>'system.title'),'B')|| | |
setweight(to_tsvector('english',fields->>'system.description'),'C')|| | |
setweight(to_tsvector('english', id::text),'A') | |
@@ to_tsquery('english','description') | |
CREATE INDEX IF NOT EXISTS fields_title ON work_items USING GIN (to_tsvector(’english’, fields->>'system.title')); | |
select plainto_tsquery('english','sbose OR http://www.fooofle.com/trtrtrjtr'); | |
select to_tsquery('sbose & ( 53* | www.fooofle.com/trtrtrjtr/454* )'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package remoteworkitem | |
import ( | |
"encoding/json" | |
"github.com/almighty/almighty-core/app" | |
) | |
// List of supported attributes | |
const ( |