I recently found Shoes, when researching how to write a gui app in Ruby. It's really great, I'm enjoying it tremendously it has great power in it's elegant simplicity. I developed the app that I had in mind in just a few hours, including going through the shoes tutorial, under red_shoes. When I went to figure out how to easily deploy the app, I decided that green_shoes was the answer, and ported the app. However, I found one big difference between the two. Under red shoes, the following resulted in an application which initially came up full screen: Shoes.app(:title => "Information",:fullscreen => true) do However, when I ported it to green shoes, the following port did not initially come up full screen: Shoes.app(title: "Information",fullscreen: true) do Does anyone know a solution to this issue? I would really like this app to come up full screen. ------------ On a different topic. From reading on the librelist archives, I've found out the following: - Red Shoes (assumption, please correct me if I'm wrong) is the original shoes package that I downloaded the source and compiled on my Linux x86-64 machine. It's written in a combination of Ruby + higher level languages. - Green Shoes is the redevelopment of Shoes in native Ruby. Can be installed as a gem. - Purple Shoes is the redevelopment of Shoes in Jruby using calls out to SWT for the graphics. So, what is Brown Shoes? I've searched, but haven't found an explaination to that. Are there any others? Thanks for your help. Ron
On Sep 27, 2012, at 1:54 PM, Ron Wolf <RonaldBWolf@wolfamily.net> wrote: > On a different topic. From reading on the librelist archives, I've found out the following: > > • Red Shoes (assumption, please correct me if I'm wrong) is the original shoes package that I downloaded the source and compiled on my Linux x86-64 machine. It's written in a combination of Ruby + higher level languages. > • Green Shoes is the redevelopment of Shoes in native Ruby. Can be installed as a gem. > • Purple Shoes is the redevelopment of Shoes in Jruby using calls out to SWT for the graphics. > So, what is Brown Shoes? I've searched, but haven't found an explaination to that. > > Are there any others? Brown Shoes has been absorbed into Shoes 4[1]. It was an implementation of Shoes with a JRuby/Java-based backend. Most of the current development is happening at Shoes 4. Shoes 4 is working on specifying the Shoes DSL in Ruby, so that we can reuse the DSL with a variety of compatible backend implementations (Java/Swt, Qt, Gtk, etc). It also has a specifications suite, so we can test the behavior of the DSL, and test the backends for compatibility. We are writing the "reference" backend in JRuby/Swt. ashbb is bringing lots of expertise from writing Purple Shoes. Hope that helps! Eric [1] https://github.com/shoes/shoes4
Hi Ron, > I recently found Shoes,... Wow, welcome to Shoes! :-D > I developed the app that I had in mind in just a few hours, > including going through the shoes tutorial, under red_shoes. Fantastic! > However, when I ported it to green shoes, the following port > did not initially come up full screen: > > Shoes.app(title: "Information",fullscreen: true) do Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > I would really like this app to come up full screen. I don't have any solution for now. But can you share your app code for us? If you can, I'll try to find a solution to implement full screen mode on Green Shoes. > what is Brown Shoes? As Eric already mentioned, it is called "Shoes 4" now. Eric works outstanding performance of ShoesSpec! Cheers, ashbb
Hello, Eric, ashbb, Thanks for your help.
I'm a Linux workstation administrator. My users move desks from time to
time, and sometimes I have to go find machines (and have a hard time
finding where they've moved). The purpose of this app is to get my users
to tell me where the machines have been moved to. It saves the information
in a JSON encoded file, and I'll write a set of "puppet custom facts" that
will import this info into my inventory. I have another script that will
run this one if certain criteria has been met. Here's my Shoes code:
==============================
require 'green_shoes'
require 'json'
Shoes.app(title: "Machine Inventory Information",fullscreen: true) do
# Setup global variables & Read Initial Values from JSON file
@info = {}
@facts_file = "Extra_Puppet_Facts.json"
@location_list = ["Location 1", "Location 2", "Location 3","Virtual
Space","Not on list" ]
@purpose_list = [ "Development","Puppet Server", "Analysis", "Database",
"Testing","Not on list" ]
# Save JSON info
def save_json_info
begin
File.open(@facts_file, "w+") {|f| f.write(@info.to_json) }
rescue Exception => e
alert("Error: #{e}, \nUnable to write!")
end
end
# Save initial variables from JSON file
def save_defaults
@label_default = @info["Label"]
@assigned_to_default = @info["Assigned To"]
@location_default = @info["Location"]
@purpose_default = @info["Purpose"]
save_json_info
end
# save modified variables from JSON file
def save_vars
info = Hash.new()
info["Label"] = @label.text
info["Assigned To"] = @assigned_to.text
# if location was not on the list, let the user enter it
if @location.text == "Not on list"
info['Location'] = ask("Enter Location:")
else
info["Location"] = @location.text
end
# if location was not on the list, enter it
if @purpose.text == "Not on list"
info['Purpose'] = ask("Enter Purpose:")
else
info["Purpose"] = @purpose.text
end
save_json_info
end
#=====================================================================
begin
@info = JSON.load(File.open(@facts_file){|f| f.read()})
rescue Exception => e
#alert("Warning: #{e}, \nproceeding with defaults.")
@info["Label"] = ""
@info["Assigned To"] = ""
@info["Location"] = ""
@info["Purpose"] = ""
end
@label_default = @info["Label"]
@assigned_to_default = @info["Assigned To"]
@location_default = @info["Location"]
if @location_default != "" and !@location_list.include?(@location_default)
@location_list.push(@location_default)
end
@purpose_default = @info["Purpose"]
if @purpose_default != "" and !@purpose_list.include?(@purpose_default)
@purpose_list.push(@purpose_default)
end
background yellow
stack(margin: 10) do
subtitle "Machine Inventory Information"
para "Please take a moment to verify and/or set these few pieces of
information about this machine"
para ""
flow do
para "Label: "
@label = edit_line(@label_default)
end
para sub " (what the physical label on the machine says)"
flow do
para "Assigned To: "
@assigned_to = edit_line(@assigned_to_default)
end
para sub " (the pod or person to whom the machine is assigned)"
flow do
para "Location: "
if @location_list.include?(@location_default)
@location = list_box(items: @location_list, choose:
@location_default)
else
@location = list_box(items: @location_list)
end
end
para sub " (where the machine is physically located)"
flow do
para "Purpose: "
if @purpose_list.include?(@purpose_default)
@purpose = list_box(items: @purpose_list, choose: @purpose_default)
else
@purpose = list_box(items: @purpose_list)
end
end
para sub " (Purpose for which the machine is used)"
flow do
button "Keep Current Info" do
save_defaults
exit
end
button "Save Values" do
save_vars
exit
end
end
end
end
On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com> wrote:
> Hi Ron,
>
> > I recently found Shoes,...
> Wow, welcome to Shoes! :-D
>
>
> > I developed the app that I had in mind in just a few hours,
> > including going through the shoes tutorial, under red_shoes.
> Fantastic!
>
>
> > However, when I ported it to green shoes, the following port
> > did not initially come up full screen:
> >
> > Shoes.app(title: "Information",fullscreen: true) do
> Ah,... sorry. Green Shoes doesn't support fullscreen style so far.
>
>
> > I would really like this app to come up full screen.
> I don't have any solution for now.
> But can you share your app code for us?
> If you can, I'll try to find a solution to implement full screen mode on
> Green Shoes.
>
> > what is Brown Shoes?
> As Eric already mentioned, it is called "Shoes 4" now.
> Eric works outstanding performance of ShoesSpec!
>
> Cheers,
> ashbb
>
--
Ron Wolf
RonaldBWolf@wolfamily.net
Have you considered using a traceroute to find the nearest switch the computer is connected to, then query the switch over telnet or it's web interface to figure out which port is mapped to that ethernet mac address? You could automate it as a cron job - you'd just have to make sure all the computers send some traffic from time to time to make sure they're in the switches table, and make it resilient to anyone being a jerk and flushing the switch tables with mac spoofing. And of course the switch would need some interface you could scrape for this data, but it'd have to be a pretty crummy switch if it didn't have any remote interface. That should get it down to which ethernet port in the wall the computer is plugged in to. — Jenna On Tuesday, 2 October 2012 at 6:49 AM, Ron Wolf wrote: > Hello, Eric, ashbb, Thanks for your help. > > I'm a Linux workstation administrator. My users move desks from time to time, and sometimes I have to go find machines (and have a hard time finding where they've moved). The purpose of this app is to get my users to tell me where the machines have been moved to. It saves the information in a JSON encoded file, and I'll write a set of "puppet custom facts" that will import this info into my inventory. I have another script that will run this one if certain criteria has been met. Here's my Shoes code: > > ============================== > > require 'green_shoes' > require 'json' > > Shoes.app(title: "Machine Inventory Information",fullscreen: true) do > # Setup global variables & Read Initial Values from JSON file > @info = {} > @facts_file = "Extra_Puppet_Facts.json" > @location_list = ["Location 1", "Location 2", "Location 3","Virtual Space","Not on list" ] > @purpose_list = [ "Development","Puppet Server", "Analysis", "Database", "Testing","Not on list" ] > > # Save JSON info > def save_json_info > begin > File.open(@facts_file, "w+") {|f| f.write(@info.to_json) } > rescue Exception => e > alert("Error: #{e}, \nUnable to write!") > end > end > > # Save initial variables from JSON file > def save_defaults > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > @purpose_default = @info["Purpose"] > > save_json_info > end > > # save modified variables from JSON file > def save_vars > info = Hash.new() > info["Label"] = @label.text > info["Assigned To"] = @assigned_to.text > > # if location was not on the list, let the user enter it > if @location.text == "Not on list" > info['Location'] = ask("Enter Location:") > else > info["Location"] = @location.text > end > > # if location was not on the list, enter it > if @purpose.text == "Not on list" > info['Purpose'] = ask("Enter Purpose:") > else > info["Purpose"] = @purpose.text > end > save_json_info > end > > #===================================================================== > > begin > @info = JSON.load(File.open(@facts_file){|f| f.read()}) > rescue Exception => e > #alert("Warning: #{e}, \nproceeding with defaults.") > @info["Label"] = "" > @info["Assigned To"] = "" > @info["Location"] = "" > @info["Purpose"] = "" > end > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > if @location_default != "" and !@location_list.include?(@location_default) > @location_list.push(@location_default) > end > @purpose_default = @info["Purpose"] > if @purpose_default != "" and !@purpose_list.include?(@purpose_default) > @purpose_list.push(@purpose_default) > end > background yellow > stack(margin: 10) do > subtitle "Machine Inventory Information" > para "Please take a moment to verify and/or set these few pieces of information about this machine" > para "" > flow do > para "Label: " > @label = edit_line(@label_default) > end > para sub " (what the physical label on the machine says)" > flow do > para "Assigned To: " > @assigned_to = edit_line(@assigned_to_default) > end > para sub " (the pod or person to whom the machine is assigned)" > flow do > para "Location: " > if @location_list.include?(@location_default) > @location = list_box(items: @location_list, choose: @location_default) > else > @location = list_box(items: @location_list) > end > end > para sub " (where the machine is physically located)" > flow do > para "Purpose: " > if @purpose_list.include?(@purpose_default) > @purpose = list_box(items: @purpose_list, choose: @purpose_default) > else > @purpose = list_box(items: @purpose_list) > end > end > para sub " (Purpose for which the machine is used)" > flow do > button "Keep Current Info" do > save_defaults > exit > end > button "Save Values" do > save_vars > exit > end > end > end > end > > > On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com (mailto:ashbbb@gmail.com)> wrote: > > Hi Ron, > > > > > I recently found Shoes,... > > Wow, welcome to Shoes! :-D > > > > > > > I developed the app that I had in mind in just a few hours, > > > including going through the shoes tutorial, under red_shoes. > > Fantastic! > > > > > > > However, when I ported it to green shoes, the following port > > > did not initially come up full screen: > > > > > > Shoes.app(title: "Information",fullscreen: true) do > > Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > > > > > > > I would really like this app to come up full screen. > > I don't have any solution for now. > > But can you share your app code for us? > > If you can, I'll try to find a solution to implement full screen mode on Green Shoes. > > > > > what is Brown Shoes? > > As Eric already mentioned, it is called "Shoes 4" now. > > Eric works outstanding performance of ShoesSpec! > > > > Cheers, > > ashbb > > > > -- > > Ron Wolf > RonaldBWolf@wolfamily.net (mailto:RonaldBWolf@wolfamily.net) > >
While I'm not a security expert, that does sound a lot easier than what Ron was suggesting. Much more appealing from a sysadmin perspective too. -- James Gifford On Oct 1, 2012 7:07 PM, "Jenna Fox" <a@creativepony.com> wrote: > Have you considered using a traceroute to find the nearest switch the > computer is connected to, then query the switch over telnet or it's web > interface to figure out which port is mapped to that ethernet mac address? > You could automate it as a cron job - you'd just have to make sure all the > computers send some traffic from time to time to make sure they're in the > switches table, and make it resilient to anyone being a jerk and flushing > the switch tables with mac spoofing. And of course the switch would need > some interface you could scrape for this data, but it'd have to be a pretty > crummy switch if it didn't have any remote interface. That should get it > down to which ethernet port in the wall the computer is plugged in to. > > — > Jenna > > On Tuesday, 2 October 2012 at 6:49 AM, Ron Wolf wrote: > > Hello, Eric, ashbb, Thanks for your help. > > I'm a Linux workstation administrator. My users move desks from time to > time, and sometimes I have to go find machines (and have a hard time > finding where they've moved). The purpose of this app is to get my users > to tell me where the machines have been moved to. It saves the information > in a JSON encoded file, and I'll write a set of "puppet custom facts" that > will import this info into my inventory. I have another script that will > run this one if certain criteria has been met. Here's my Shoes code: > > ============================== > > require 'green_shoes' > require 'json' > > Shoes.app(title: "Machine Inventory Information",fullscreen: true) do > # Setup global variables & Read Initial Values from JSON file > @info = {} > @facts_file = "Extra_Puppet_Facts.json" > @location_list = ["Location 1", "Location 2", "Location 3","Virtual > Space","Not on list" ] > @purpose_list = [ "Development","Puppet Server", "Analysis", "Database", > "Testing","Not on list" ] > > # Save JSON info > def save_json_info > begin > File.open(@facts_file, "w+") {|f| f.write(@info.to_json) } > rescue Exception => e > alert("Error: #{e}, \nUnable to write!") > end > end > > # Save initial variables from JSON file > def save_defaults > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > @purpose_default = @info["Purpose"] > > save_json_info > end > > # save modified variables from JSON file > def save_vars > info = Hash.new() > info["Label"] = @label.text > info["Assigned To"] = @assigned_to.text > > # if location was not on the list, let the user enter it > if @location.text == "Not on list" > info['Location'] = ask("Enter Location:") > else > info["Location"] = @location.text > end > > # if location was not on the list, enter it > if @purpose.text == "Not on list" > info['Purpose'] = ask("Enter Purpose:") > else > info["Purpose"] = @purpose.text > end > save_json_info > end > > #===================================================================== > > begin > @info = JSON.load(File.open(@facts_file){|f| f.read()}) > rescue Exception => e > #alert("Warning: #{e}, \nproceeding with defaults.") > @info["Label"] = "" > @info["Assigned To"] = "" > @info["Location"] = "" > @info["Purpose"] = "" > end > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > if @location_default != "" and > !@location_list.include?(@location_default) > @location_list.push(@location_default) > end > @purpose_default = @info["Purpose"] > if @purpose_default != "" and !@purpose_list.include?(@purpose_default) > @purpose_list.push(@purpose_default) > end > background yellow > stack(margin: 10) do > subtitle "Machine Inventory Information" > para "Please take a moment to verify and/or set these few pieces of > information about this machine" > para "" > flow do > para "Label: " > @label = edit_line(@label_default) > end > para sub " (what the physical label on the machine says)" > flow do > para "Assigned To: " > @assigned_to = edit_line(@assigned_to_default) > end > para sub " (the pod or person to whom the machine is assigned)" > flow do > para "Location: " > if @location_list.include?(@location_default) > @location = list_box(items: @location_list, choose: > @location_default) > else > @location = list_box(items: @location_list) > end > end > para sub " (where the machine is physically located)" > flow do > para "Purpose: " > if @purpose_list.include?(@purpose_default) > @purpose = list_box(items: @purpose_list, choose: @purpose_default) > else > @purpose = list_box(items: @purpose_list) > end > end > para sub " (Purpose for which the machine is used)" > flow do > button "Keep Current Info" do > save_defaults > exit > end > button "Save Values" do > save_vars > exit > end > end > end > end > > > On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com> wrote: > > Hi Ron, > > > I recently found Shoes,... > Wow, welcome to Shoes! :-D > > > > I developed the app that I had in mind in just a few hours, > > including going through the shoes tutorial, under red_shoes. > Fantastic! > > > > However, when I ported it to green shoes, the following port > > did not initially come up full screen: > > > > Shoes.app(title: "Information",fullscreen: true) do > Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > > > > I would really like this app to come up full screen. > I don't have any solution for now. > But can you share your app code for us? > If you can, I'll try to find a solution to implement full screen mode on > Green Shoes. > > > what is Brown Shoes? > As Eric already mentioned, it is called "Shoes 4" now. > Eric works outstanding performance of ShoesSpec! > > Cheers, > ashbb > > > > > -- > > Ron Wolf > RonaldBWolf@wolfamily.net > > > >
I hope you're in net security somewhere Jenna. That was WAAYYY too specific! Watching my back. Shoes On Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibbons@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibbons@gmail.com On Mon, Oct 1, 2012 at 6:06 PM, Jenna Fox <a@creativepony.com> wrote: > Have you considered using a traceroute to find the nearest switch the > computer is connected to, then query the switch over telnet or it's web > interface to figure out which port is mapped to that ethernet mac address? > You could automate it as a cron job - you'd just have to make sure all the > computers send some traffic from time to time to make sure they're in the > switches table, and make it resilient to anyone being a jerk and flushing > the switch tables with mac spoofing. And of course the switch would need > some interface you could scrape for this data, but it'd have to be a pretty > crummy switch if it didn't have any remote interface. That should get it > down to which ethernet port in the wall the computer is plugged in to. > > — > Jenna > > On Tuesday, 2 October 2012 at 6:49 AM, Ron Wolf wrote: > > Hello, Eric, ashbb, Thanks for your help. > > I'm a Linux workstation administrator. My users move desks from time to > time, and sometimes I have to go find machines (and have a hard time > finding where they've moved). The purpose of this app is to get my users > to tell me where the machines have been moved to. It saves the information > in a JSON encoded file, and I'll write a set of "puppet custom facts" that > will import this info into my inventory. I have another script that will > run this one if certain criteria has been met. Here's my Shoes code: > > ============================== > > require 'green_shoes' > require 'json' > > Shoes.app(title: "Machine Inventory Information",fullscreen: true) do > # Setup global variables & Read Initial Values from JSON file > @info = {} > @facts_file = "Extra_Puppet_Facts.json" > @location_list = ["Location 1", "Location 2", "Location 3","Virtual > Space","Not on list" ] > @purpose_list = [ "Development","Puppet Server", "Analysis", "Database", > "Testing","Not on list" ] > > # Save JSON info > def save_json_info > begin > File.open(@facts_file, "w+") {|f| f.write(@info.to_json) } > rescue Exception => e > alert("Error: #{e}, \nUnable to write!") > end > end > > # Save initial variables from JSON file > def save_defaults > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > @purpose_default = @info["Purpose"] > > save_json_info > end > > # save modified variables from JSON file > def save_vars > info = Hash.new() > info["Label"] = @label.text > info["Assigned To"] = @assigned_to.text > > # if location was not on the list, let the user enter it > if @location.text == "Not on list" > info['Location'] = ask("Enter Location:") > else > info["Location"] = @location.text > end > > # if location was not on the list, enter it > if @purpose.text == "Not on list" > info['Purpose'] = ask("Enter Purpose:") > else > info["Purpose"] = @purpose.text > end > save_json_info > end > > #===================================================================== > > begin > @info = JSON.load(File.open(@facts_file){|f| f.read()}) > rescue Exception => e > #alert("Warning: #{e}, \nproceeding with defaults.") > @info["Label"] = "" > @info["Assigned To"] = "" > @info["Location"] = "" > @info["Purpose"] = "" > end > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > if @location_default != "" and > !@location_list.include?(@location_default) > @location_list.push(@location_default) > end > @purpose_default = @info["Purpose"] > if @purpose_default != "" and !@purpose_list.include?(@purpose_default) > @purpose_list.push(@purpose_default) > end > background yellow > stack(margin: 10) do > subtitle "Machine Inventory Information" > para "Please take a moment to verify and/or set these few pieces of > information about this machine" > para "" > flow do > para "Label: " > @label = edit_line(@label_default) > end > para sub " (what the physical label on the machine says)" > flow do > para "Assigned To: " > @assigned_to = edit_line(@assigned_to_default) > end > para sub " (the pod or person to whom the machine is assigned)" > flow do > para "Location: " > if @location_list.include?(@location_default) > @location = list_box(items: @location_list, choose: > @location_default) > else > @location = list_box(items: @location_list) > end > end > para sub " (where the machine is physically located)" > flow do > para "Purpose: " > if @purpose_list.include?(@purpose_default) > @purpose = list_box(items: @purpose_list, choose: @purpose_default) > else > @purpose = list_box(items: @purpose_list) > end > end > para sub " (Purpose for which the machine is used)" > flow do > button "Keep Current Info" do > save_defaults > exit > end > button "Save Values" do > save_vars > exit > end > end > end > end > > > On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com> wrote: > > Hi Ron, > > > I recently found Shoes,... > Wow, welcome to Shoes! :-D > > > > I developed the app that I had in mind in just a few hours, > > including going through the shoes tutorial, under red_shoes. > Fantastic! > > > > However, when I ported it to green shoes, the following port > > did not initially come up full screen: > > > > Shoes.app(title: "Information",fullscreen: true) do > Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > > > > I would really like this app to come up full screen. > I don't have any solution for now. > But can you share your app code for us? > If you can, I'll try to find a solution to implement full screen mode on > Green Shoes. > > > what is Brown Shoes? > As Eric already mentioned, it is called "Shoes 4" now. > Eric works outstanding performance of ShoesSpec! > > Cheers, > ashbb > > > > > -- > > Ron Wolf > RonaldBWolf@wolfamily.net > > > >
Did you know that many banks now offer free wifi for their customers at branches? And that wifi is often connected to the same switches as their internal systems? And that while the routers involved are configured to route them as two separate networks, the switches are not working on that level and when flooded with requests from hundreds of thousands of forged mac addresses flushing out their tables using simple common place rubygems, the switches effectively become hubs, transmitting all packets to all ports, including the wifi access points, where the internal traffic of that bank branch is shared with your laptop or phone? Now THAT's way too specific! — Jenna On Tuesday, 2 October 2012 at 12:43 PM, Peter Fitzgibbons wrote: > I hope you're in net security somewhere Jenna. That was WAAYYY too specific! > > Watching my back. > > Shoes On > > Peter Fitzgibbons > (847) 859-9550 > Email: peter.fitzgibbons@gmail.com (mailto:peter.fitzgibbons@gmail.com) > IM GTalk: peter.fitzgibbons > IM AOL: peter.fitzgibbons@gmail.com (mailto:peter.fitzgibbons@gmail.com) > > > On Mon, Oct 1, 2012 at 6:06 PM, Jenna Fox <a@creativepony.com (mailto:a@creativepony.com)> wrote: > > Have you considered using a traceroute to find the nearest switch the computer is connected to, then query the switch over telnet or it's web interface to figure out which port is mapped to that ethernet mac address? You could automate it as a cron job - you'd just have to make sure all the computers send some traffic from time to time to make sure they're in the switches table, and make it resilient to anyone being a jerk and flushing the switch tables with mac spoofing. And of course the switch would need some interface you could scrape for this data, but it'd have to be a pretty crummy switch if it didn't have any remote interface. That should get it down to which ethernet port in the wall the computer is plugged in to. > > > > — > > Jenna > > > > > > On Tuesday, 2 October 2012 at 6:49 AM, Ron Wolf wrote: > > > > > Hello, Eric, ashbb, Thanks for your help. > > > > > > I'm a Linux workstation administrator. My users move desks from time to time, and sometimes I have to go find machines (and have a hard time finding where they've moved). The purpose of this app is to get my users to tell me where the machines have been moved to. It saves the information in a JSON encoded file, and I'll write a set of "puppet custom facts" that will import this info into my inventory. I have another script that will run this one if certain criteria has been met. Here's my Shoes code: > > > > > > ============================== > > > > > > require 'green_shoes' > > > require 'json' > > > > > > Shoes.app(title: "Machine Inventory Information",fullscreen: true) do > > > # Setup global variables & Read Initial Values from JSON file > > > @info = {} > > > @facts_file = "Extra_Puppet_Facts.json" > > > @location_list = ["Location 1", "Location 2", "Location 3","Virtual Space","Not on list" ] > > > @purpose_list = [ "Development","Puppet Server", "Analysis", "Database", "Testing","Not on list" ] > > > > > > # Save JSON info > > > def save_json_info > > > begin > > > File.open(@facts_file, "w+") {|f| f.write(@info.to_json) } > > > rescue Exception => e > > > alert("Error: #{e}, \nUnable to write!") > > > end > > > end > > > > > > # Save initial variables from JSON file > > > def save_defaults > > > @label_default = @info["Label"] > > > @assigned_to_default = @info["Assigned To"] > > > @location_default = @info["Location"] > > > @purpose_default = @info["Purpose"] > > > > > > save_json_info > > > end > > > > > > # save modified variables from JSON file > > > def save_vars > > > info = Hash.new() > > > info["Label"] = @label.text > > > info["Assigned To"] = @assigned_to.text > > > > > > # if location was not on the list, let the user enter it > > > if @location.text == "Not on list" > > > info['Location'] = ask("Enter Location:") > > > else > > > info["Location"] = @location.text > > > end > > > > > > # if location was not on the list, enter it > > > if @purpose.text == "Not on list" > > > info['Purpose'] = ask("Enter Purpose:") > > > else > > > info["Purpose"] = @purpose.text > > > end > > > save_json_info > > > end > > > > > > #===================================================================== > > > > > > begin > > > @info = JSON.load(File.open(@facts_file){|f| f.read()}) > > > rescue Exception => e > > > #alert("Warning: #{e}, \nproceeding with defaults.") > > > @info["Label"] = "" > > > @info["Assigned To"] = "" > > > @info["Location"] = "" > > > @info["Purpose"] = "" > > > end > > > @label_default = @info["Label"] > > > @assigned_to_default = @info["Assigned To"] > > > @location_default = @info["Location"] > > > if @location_default != "" and !@location_list.include?(@location_default) > > > @location_list.push(@location_default) > > > end > > > @purpose_default = @info["Purpose"] > > > if @purpose_default != "" and !@purpose_list.include?(@purpose_default) > > > @purpose_list.push(@purpose_default) > > > end > > > background yellow > > > stack(margin: 10) do > > > subtitle "Machine Inventory Information" > > > para "Please take a moment to verify and/or set these few pieces of information about this machine" > > > para "" > > > flow do > > > para "Label: " > > > @label = edit_line(@label_default) > > > end > > > para sub " (what the physical label on the machine says)" > > > flow do > > > para "Assigned To: " > > > @assigned_to = edit_line(@assigned_to_default) > > > end > > > para sub " (the pod or person to whom the machine is assigned)" > > > flow do > > > para "Location: " > > > if @location_list.include?(@location_default) > > > @location = list_box(items: @location_list, choose: @location_default) > > > else > > > @location = list_box(items: @location_list) > > > end > > > end > > > para sub " (where the machine is physically located)" > > > flow do > > > para "Purpose: " > > > if @purpose_list.include?(@purpose_default) > > > @purpose = list_box(items: @purpose_list, choose: @purpose_default) > > > else > > > @purpose = list_box(items: @purpose_list) > > > end > > > end > > > para sub " (Purpose for which the machine is used)" > > > flow do > > > button "Keep Current Info" do > > > save_defaults > > > exit > > > end > > > button "Save Values" do > > > save_vars > > > exit > > > end > > > end > > > end > > > end > > > > > > > > > On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com (mailto:ashbbb@gmail.com)> wrote: > > > > Hi Ron, > > > > > > > > > I recently found Shoes,... > > > > Wow, welcome to Shoes! :-D > > > > > > > > > > > > > I developed the app that I had in mind in just a few hours, > > > > > including going through the shoes tutorial, under red_shoes. > > > > Fantastic! > > > > > > > > > > > > > However, when I ported it to green shoes, the following port > > > > > did not initially come up full screen: > > > > > > > > > > Shoes.app(title: "Information",fullscreen: true) do > > > > Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > > > > > > > > > > > > > I would really like this app to come up full screen. > > > > I don't have any solution for now. > > > > But can you share your app code for us? > > > > If you can, I'll try to find a solution to implement full screen mode on Green Shoes. > > > > > > > > > what is Brown Shoes? > > > > As Eric already mentioned, it is called "Shoes 4" now. > > > > Eric works outstanding performance of ShoesSpec! > > > > > > > > Cheers, > > > > ashbb > > > > > > > > > > > > -- > > > > > > Ron Wolf > > > RonaldBWolf@wolfamily.net (mailto:RonaldBWolf@wolfamily.net) > > > > > > > > >
Nice! Peter Fitzgibbons (847) 859-9550 Email: peter.fitzgibbons@gmail.com IM GTalk: peter.fitzgibbons IM AOL: peter.fitzgibbons@gmail.com On Mon, Oct 1, 2012 at 10:02 PM, Jenna Fox <a@creativepony.com> wrote: > Did you know that many banks now offer free wifi for their customers at > branches? And that wifi is often connected to the same switches as their > internal systems? And that while the routers involved are configured to > route them as two separate networks, the switches are not working on that > level and when flooded with requests from hundreds of thousands of forged > mac addresses flushing out their tables using simple common place rubygems, > the switches effectively become hubs, transmitting all packets to all > ports, including the wifi access points, where the internal traffic of that > bank branch is shared with your laptop or phone? > > Now THAT's way too specific! > > > — > Jenna > > On Tuesday, 2 October 2012 at 12:43 PM, Peter Fitzgibbons wrote: > > I hope you're in net security somewhere Jenna. That was WAAYYY too > specific! > > Watching my back. > > Shoes On > > Peter Fitzgibbons > (847) 859-9550 > Email: peter.fitzgibbons@gmail.com > IM GTalk: peter.fitzgibbons > IM AOL: peter.fitzgibbons@gmail.com > > > On Mon, Oct 1, 2012 at 6:06 PM, Jenna Fox <a@creativepony.com> wrote: > > Have you considered using a traceroute to find the nearest switch the > computer is connected to, then query the switch over telnet or it's web > interface to figure out which port is mapped to that ethernet mac address? > You could automate it as a cron job - you'd just have to make sure all the > computers send some traffic from time to time to make sure they're in the > switches table, and make it resilient to anyone being a jerk and flushing > the switch tables with mac spoofing. And of course the switch would need > some interface you could scrape for this data, but it'd have to be a pretty > crummy switch if it didn't have any remote interface. That should get it > down to which ethernet port in the wall the computer is plugged in to. > > — > Jenna > > On Tuesday, 2 October 2012 at 6:49 AM, Ron Wolf wrote: > > Hello, Eric, ashbb, Thanks for your help. > > I'm a Linux workstation administrator. My users move desks from time to > time, and sometimes I have to go find machines (and have a hard time > finding where they've moved). The purpose of this app is to get my users > to tell me where the machines have been moved to. It saves the information > in a JSON encoded file, and I'll write a set of "puppet custom facts" that > will import this info into my inventory. I have another script that will > run this one if certain criteria has been met. Here's my Shoes code: > > ============================== > > require 'green_shoes' > require 'json' > > Shoes.app(title: "Machine Inventory Information",fullscreen: true) do > # Setup global variables & Read Initial Values from JSON file > @info = {} > @facts_file = "Extra_Puppet_Facts.json" > @location_list = ["Location 1", "Location 2", "Location 3","Virtual > Space","Not on list" ] > @purpose_list = [ "Development","Puppet Server", "Analysis", "Database", > "Testing","Not on list" ] > > # Save JSON info > def save_json_info > begin > File.open(@facts_file, "w+") {|f| f.write(@info.to_json) } > rescue Exception => e > alert("Error: #{e}, \nUnable to write!") > end > end > > # Save initial variables from JSON file > def save_defaults > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > @purpose_default = @info["Purpose"] > > save_json_info > end > > # save modified variables from JSON file > def save_vars > info = Hash.new() > info["Label"] = @label.text > info["Assigned To"] = @assigned_to.text > > # if location was not on the list, let the user enter it > if @location.text == "Not on list" > info['Location'] = ask("Enter Location:") > else > info["Location"] = @location.text > end > > # if location was not on the list, enter it > if @purpose.text == "Not on list" > info['Purpose'] = ask("Enter Purpose:") > else > info["Purpose"] = @purpose.text > end > save_json_info > end > > #===================================================================== > > begin > @info = JSON.load(File.open(@facts_file){|f| f.read()}) > rescue Exception => e > #alert("Warning: #{e}, \nproceeding with defaults.") > @info["Label"] = "" > @info["Assigned To"] = "" > @info["Location"] = "" > @info["Purpose"] = "" > end > @label_default = @info["Label"] > @assigned_to_default = @info["Assigned To"] > @location_default = @info["Location"] > if @location_default != "" and > !@location_list.include?(@location_default) > @location_list.push(@location_default) > end > @purpose_default = @info["Purpose"] > if @purpose_default != "" and !@purpose_list.include?(@purpose_default) > @purpose_list.push(@purpose_default) > end > background yellow > stack(margin: 10) do > subtitle "Machine Inventory Information" > para "Please take a moment to verify and/or set these few pieces of > information about this machine" > para "" > flow do > para "Label: " > @label = edit_line(@label_default) > end > para sub " (what the physical label on the machine says)" > flow do > para "Assigned To: " > @assigned_to = edit_line(@assigned_to_default) > end > para sub " (the pod or person to whom the machine is assigned)" > flow do > para "Location: " > if @location_list.include?(@location_default) > @location = list_box(items: @location_list, choose: > @location_default) > else > @location = list_box(items: @location_list) > end > end > para sub " (where the machine is physically located)" > flow do > para "Purpose: " > if @purpose_list.include?(@purpose_default) > @purpose = list_box(items: @purpose_list, choose: @purpose_default) > else > @purpose = list_box(items: @purpose_list) > end > end > para sub " (Purpose for which the machine is used)" > flow do > button "Keep Current Info" do > save_defaults > exit > end > button "Save Values" do > save_vars > exit > end > end > end > end > > > On Fri, Sep 28, 2012 at 6:49 PM, ashbb <ashbbb@gmail.com> wrote: > > Hi Ron, > > > I recently found Shoes,... > Wow, welcome to Shoes! :-D > > > > I developed the app that I had in mind in just a few hours, > > including going through the shoes tutorial, under red_shoes. > Fantastic! > > > > However, when I ported it to green shoes, the following port > > did not initially come up full screen: > > > > Shoes.app(title: "Information",fullscreen: true) do > Ah,... sorry. Green Shoes doesn't support fullscreen style so far. > > > > I would really like this app to come up full screen. > I don't have any solution for now. > But can you share your app code for us? > If you can, I'll try to find a solution to implement full screen mode on > Green Shoes. > > > what is Brown Shoes? > As Eric already mentioned, it is called "Shoes 4" now. > Eric works outstanding performance of ShoesSpec! > > Cheers, > ashbb > > > > > -- > > Ron Wolf > RonaldBWolf@wolfamily.net > > > > > >
Hi Ron, Thank you for sharing your great Green Shoes app! :-D I added fullscreen style tonight. Try out 1.1.366. Hope it helps, ashbb
WOW! Thanks, ashbb. It worked perfectly. Thanks for the quick response. On Tue, Oct 2, 2012 at 6:53 AM, ashbb <ashbbb@gmail.com> wrote: > Hi Ron, > > Thank you for sharing your great Green Shoes app! :-D > > I added fullscreen style tonight. Try out 1.1.366. > > Hope it helps, > ashbb > -- Ron Wolf RonaldBWolf@wolfamily.net