Linux character issue
Closed this issue · 3 comments
ChrisThornton commented
I cloned wordsmith over to kali Linux and I get an error when I run it
~/wordsmith# ruby wordsmith.rb
wordsmith.rb:357: invalid multibyte char (US-ASCII)
wordsmith.rb:357: invalid multibyte char (US-ASCII)
wordsmith.rb:357: syntax error, unexpected $end, expecting ')'
cities = cities.each {|city| city.gsub!(/â /,'')}
^
This same version does work on mac-os, just not Linux .
skahwah commented
Thanks for your feedback. I just tried running wordsmith in Kali and it ran without any problems. Can you replace the first line:
#!/usr/local/bin/ruby
With:
#!/bin/env ruby
# encoding: utf-8
Let me know if that works for you?
skahwah commented
root@kali:~# git clone https://github.com/skahwah/wordsmith.git
Cloning into 'wordsmith'...
remote: Counting objects: 70, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 70 (delta 0), reused 0 (delta 0), pack-reused 67
Unpacking objects: 100% (70/70), done.
Checking connectivity... done.
root@kali:~# cd wordsmith/
root@kali:~/wordsmith# ls
data.tar.gz Gemfile LICENSE README.md sources.yml wordsmith.rb
root@kali:~/wordsmith# ruby wordsmith.rb
wordsmith v1.0
Written by: Sanjiv "Trashcan Head" Kawa & Tom "Pain Train" Porter
Twitter: @skawasec & @porterhau5
Hello new wordsmither! Just need to unpack some files.
Unpack completed!
CeWL found: /usr/bin/cewl
Usage: ruby wordsmith.rb [options]
Main Arguments:
-s, --state <states> Comma-delimited list of US states
State Options:
-a, --all Grab everything for the specified state
-c, --cities Grab all city names for the specified state
-f, --colleges Grab all college sports for the specified state
-l, --landmarks Grab all landmarks for the specified state
-p, --phone Grab all area codes for the specified state
-r, --roads Grab all road names in the specified state
-t, --teams Grab all major sports teams in the specified state
-z, --zip Grab all zip codes for the specified state
Miscellaneous Options:
-d, --domain DOMAIN Set a URL for a web application that you want CeWL to scrape
-e, --examples Show some usage examples
-i, --infile FILE Supply a file containing multiple URLs that you want CeWL to scrape
-n, --names Grab the most common male, female, baby and last names in the USA
Output Options:
-o, --output FILE The name of the output file
-q, --quiet Don't show words generated, use with -o option
-k, --length LEN Minumum length of word to include
-j, --lowercase Convert all words to lowercase
-w, --specials Add words with special characters removed
-x, --spaces Add words with spaces removed
-y, --split Split words by space and add
-m, --mangle Add all permutations (-w, -x, -y)
Management:
-u, --update Update data from Internet sources
root@kali:~/wordsmith# ruby wordsmith.rb -s ca -t
wordsmith v1.0
Written by: Sanjiv "Trashcan Head" Kawa & Tom "Pain Train" Porter
Twitter: @skawasec & @porterhau5
-- State set to: California
Anaheim Ducks
Golden State Warriors
LA Galaxy
Los Angeles Angels of Anaheim
Los Angeles Clippers
Los Angeles Dodgers
Los Angeles FC
Los Angeles Kings
Los Angeles Lakers
Los Angeles Rams
Oakland Athletics
Oakland Raiders
Sacramento Kings
San Diego Chargers
San Diego Padres
San Francisco 49ers
San Francisco Giants
San Jose Earthquakes
San Jose Sharks
Sports teams in CA: 19
root@kali:~/wordsmith#
ChrisThornton commented
Changing
#!/bin/env ruby
to
encoding: utf-8
worked fine
Thanks.