DevHeads.net

Postings by Bee.Lists

email Server for CentOS 7

Hi folks.

I’m looking for an email server. I have a C7 box already with nginx, PostgreSQL, Sinatra and Ruby. So I don’t want to install PHP, Apache, MySQL, etc.

Are there any ways/tutorials to set up a mail server under those restrictions? It would serve multiple domains.

Cheers, Bee

postgresql Service Blind

Hi folks.

postgresql fresh install, roles, users, databases, all done. I can log in after I SSH to the box.

I entered my user (myself) in pg_hba.conf:

host all rich 192.168.1.4 255.255.255.255 md5

When I nmap the CentOS box, I can’t see that port open. I’ve turned off SELinux, so I’m not sure why I can’t see the open port 5432.

What am I missing?

SAMBA Issues

Hi folks.

For some reason my smb.conf tests just fine, but it isn’t showing up at my Mac. The box is showing, but I can’t see anything. It gives me an error as well. All is below.

<a href="https://www.unixmen.com/install-configure-samba-server-centos-7/" title="https://www.unixmen.com/install-configure-samba-server-centos-7/">https://www.unixmen.com/install-configure-samba-server-centos-7/</a> is the setup I’m trying.

The smb.conf:

[global]
workgroup = WORKGROUP
security = user

passdb backend = tdbsam

unix charset = UTF-8
hosts allow = 127.

Get PG Database Names in IRB using Sequel

Hi folks.

I need to get a list of schemas (databases) in Postgresql using Sequel. My client can perform the SQL, but for some reason, my connection in IRB doesn’t want see anything.

require ‘sequel’
require ‘pg’
d = Sequel.connect('postgres://dingbat: ... at 0 dot 0.0.0/postgres')
r = d.run('select datname, datistemplate from pg_database where datistemplate = false’)
puts r.inspect # => nil

Any workarounds that anybody knows about? I appreciate any input.

Iterate hash to make another hash

Hi folks. I can’t figure out a puzzle where I need to generate a Sequel hash from a reference hash and an array:

reference hash:

t = {:name => :company_name, :rank => :company_rank, :serial_no => :company_serial}

I want to iterate through each of those pairs and reference the value of each, into the following Sequel command:

companies.insert(t[0] => myarray[0], t[1] => myarray[1], t[2] => myarray[2])

myArray is another set of items.

String Interpolation of Compound Statement

Hi folks. I come from a language where we don’t have string interpolation. Here’s what I would usually write:

@f += "\t<label for=\"" + @h[("s_fieldname_" + i.to_s)].to_s + "\">" + @fieldname.capitalize + “:"

Now I’ve been told there are less errors with string interpolation. How can I translate that? I get hung up on the internal bit here:

@h[("s_fieldname_" + i.to_s)

I’m sure it’s out there. I appreciate any input.

Cheers, Bee

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>

Requires

Hi folks. Can someone provide some insight into how requires work with require_relative?

HQ
├── Gemfile
├── Gemfile.lock
├── app.rb
├── config.ru
├── css
│ ├── HQ.css
│ └── reset.css
├── img
│ ├── traffic.jpg
│ └── weather.gif
├── alt
│ ├── db.rb
│ └── methods.rb
├── blah.txt

In this model I would like app.rb to call methods.rb which calls db.rb when needed.

So in app.rb: require_relative(‘/alt/methods.rb’)
in methods.rb: require_relative(‘db.rb’)

Does this work?

RVM PATH & Version Confusion

Hi folks.

Can someone show me how to properly set up my RVM path? I keep getting this while RVM seems to be set up properly. I’m pointing to 2.2.1 yet it barfs on 2.0.0 for some reason:

Warning!

Ruby & Forms

Hi folks.

I’m trying to get my head around the implementation of Ruby forms. This is not Rails. I’m messing around in Sinatra and wanted to know how to receive submitted forms. I’ve looked at CGI and the params tag, but I’m unclear as to which one should be used.

Any urls and insight appreciated as I can’t find much out there. I’m confused between the two applications and I can’t seem to get params to work properly.

Cheers

Ruby & Forms

Hi folks.

I’m trying to get my head around the implementation of Ruby forms. This is not Rails. I’m messing around in Sinatra and wanted to know how to receive submitted forms. I’ve looked at CGI and the params tag, but I’m unclear as to which one should be used.

Any urls and insight appreciated as I can’t find much out there. I’m confused between the two applications and I can’t seem to get params to work properly.

Cheers