apnserver gem not sending messages from ruby daemon - ruby

i am using apnserver gem to push messages from my ruby daemon to apns, but messages are not being delivered, it shows no error. i tried sending from command line
apnsend --server gateway.push.apple.com --port 2195 --pem /home/fstech/anand/apps/demon/daemon_apns/tmp/apns-dev.pem \--hex-token 8ac76314c57640486952918f236cad321fb8cddcfa4394f191aafdf9b65cfa83\ --sound default \--alert Hello
this is the code i used, i used a message as "hello"
please help!! :)

I figured out the answer.. it was sending messages to apple sandbox! changing the server to gateway.push.apple.com made it work :)

Related

pppd on macos fail with "publish_entry SCDSet() failed"

pppd is failing for me on the Mac. I'm trying to connect to a serial port to an embedded device running lwIP. It works from both Ubuntu and Yocto, BUT not from my Mac. Since I do my development on the mac, it would be nice to get it working on the Mac.
Here's how I'm calling it:
sudo pppd /dev/tty.usbmodem336D376733381 115200 172.168.0.1:172.168.0.2 noauth debug
I get the following message back:
Mon Aug 23 15:55:51 2021 : publish_entry SCDSet() failed: Success!
So it seems to have failed...but with Success, haha :)
Any suggestions what this could be?
Please note that I have verified that /dev/tty.usbmodem336D376733381 is the correct device and has ppp related data coming from it.
Thanks,
Craig
Ok, I figured out what my issue was. I was using two FTDI serial converters connected like a null modem cable:
I did not have the flow control lines connected (because that would require soldering). In the man page for pppd, I saw that hardware flow control is ON by default. Since I didn't have those line connected, flow control was preventing data from flowing resulting in the error I was getting. I added the "nocrtscts" option to my pppd command and it now works. The command I ended up with is:
sudo pppd /dev/tty.usbmodem336D376733381 115200 172.168.0.1:172.168.0.2 noauth nocrtscts

MQCONN ended with reason code 2035

I have recently installed Websphere MQ 7.5 on solaris machines. I was trying to test communication between workstations from here. When i ran
./amqsputc QUEUE1 saturn.queue.manager
It's giving output as
Sample AMQSPUT0 start
MQCONN ended with reason code 2035
I tried changing authorization for mqm user.
setmqaut -m saturn.queue.manager -n queue1 -t queue -p mqm +all
and refreshed cache for saturn.queue.manager, still getting same error when trying to run "amqsputc ". What can be wrong?
Well, I might be better consulting to the v7.5 documentation rather than v6.
Which host are you on when you are running this test? Which user is running the amqsputc command?
Your environment might not be set up. Try this:
export MQSERVER="Channel_Name/TCP/IP_or_Hostname(port_number)"

Running websocket server with stomp

I have torquebox installed in my jruby on Rails application. And I am experimenting with using stomp + websockets. But I can't tell if the websocket server is even running? I am booting up torquebox in my console with: sudo torquebox run --clustered -b my.ip.address
I keep going through the output from torquebox booting up and the only relevant output I am seeing is this:
[org.torquebox.stomp.as] Initializing TorqueBox STOMP Subsystem
and
[org.projectodd.polyglot.stomp.as] Initializing Polyglot STOMP Subsystem
I don't see anything referencing port 8675, which according to the docs is the port it is supposed to run on. I tried telnet as well and received a 'connection refused' message.
Any help or references would be great. Thanks
Apologies for the dumb question. I just had a typo in my torquebox.yml file. I can now see the output in the bootup that specifies the websocket server is up and I can successfully telnet in.

cannot start sinatra process - eventmachine "no acceptor"

I have a Sinatra app that I run as a daemon, using Apache port-forwarding to mediate between port 80 and port 7655. This has been working fine in the past. Today, not so well. I cannot figure out why.
Problem: sudo ruby my_process.rb returns:
/var/lib/gems/1.9.1/gems/eventmachine-1.0.0/lib/eventmachine.rb:526:in `start_tcp_server': no acceptor (port is in use or requires root privileges) (RuntimeError)
Tried: updating all system packages, updating all gems. No help (except for the more clear error message from eventmachine).
When I run sudo lsof -i :7655 I get nothing back. When I run sudo ps aux I don't see any Ruby processes at all. Which I find highly irregular, given the nature of the error message!
So is there something I'm missing in finding out why the port is unavailable?
Also:
Tried changing ports, nothing. I wonder if it is related to "localhost"? When I ping localhost I get all dropped packets. That doesn't seem normal.
Turns out these two lines in the main Sinatra script provided the most information:
set bind: "localhost"
set port: 7655
The problem was with localhost. The loopback interface was not properly configured. ifconfig showed the lo interface, but it hadn't been assigned the IP 127.0.0.1. To resolve, ran the following commands in the shell (on an Ubuntu Linux system):
ifdown lo
ifup lo
When you close term sometime you forget to stop [CTRL+C] the actual server, just run the following command to kill all ruby process like sinatra, and run-it again
killall ruby
You can see your actual ruby process by running
ps -ef | grep ruby

Running Heroku Console does not start

I am trying to run Heroku console, but in the console, I get the message "Running console attached to terminal" but the console doesn't start.
In the Heroku logs, I get the error:
Error: no child processes attached.
Any help?
I just had a thread with Heroku support about my similar issue, here was their response, which worked for me.
So this is a bamboo app. You can either do
$ heroku console
which will tap into a running web dyno, or you can run a new console
as a one-off process with:
$ heroku run bundle exec rails console
On cedar apps you'd also be able to do
$ heroku run console
which also starts a one-off process, because the console process type
would be implied by the rails buildpack or declared in your Procfile.
It amounts to the same as the previous line.
I was experiencing same issues.
Try
heroku run rails console
in Rails >=3
Happy coding :)
Try
$ telnet rendezvous.heroku.com 5000
to test the net enabled access to that port. They mention that filtered-port issue on their guide
I think this is the same problem you're describing and it has an accepted answer which seemed to fix the issue for the guy that posted the question :-)
heroku run console returns 'Error connecting to process'
I had this problem before I'd actually pushed my code to heroku.
Once I successfully pushed and started everything (bundle, rake etc.) the console actually worked.
Do this and then try
In Procfile
web: bundle exec unicorn_rails -p $PORT -c config/unicorn.rb
In unicorn.rb
worker_processes 2
preload_app true
timeout 30
#resque_pid = nil
before_fork do |server, worker|
#resque_pid ||= spawn("bundle exec rake environment resque:work QUEUE=*")
end
after_fork do |server, worker|
ActiveRecord::Base.establish_connection
end

Resources