| Value | Color |
|---|---|
| \e[0;30m | Black |
| \e[0;31m | Red |
| \e[0;32m | Green |
| \e[0;33m | Yellow |
| \e[0;34m | Blue |
| \e[0;35m | Purple |
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
| [6] pry(main)> f *= 9 | |
| => "rubygemsrubygemsrubygemsrubygemsrubygemsrubygemsrubygemsrubygemsrubygems" | |
| [7] pry(main)> f /= 9 | |
| NoMethodError: undefined method `/' for #<String:0x0000000148ad40> | |
| from (pry):7:in `__pry__' | |
| [8] pry(main)> f -= 9 | |
| NoMethodError: undefined method `-' for #<String:0x0000000148ad40> | |
| Did you mean? -@ | |
| from (pry):8:in `__pry__' | |
| [9] pry(main)> f += 9 |
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
| ken@home:~$ python3 test1.py 1 password digest | |
| 1 | |
| ['password', 'digest'] | |
| ['password', 'digest'] | |
| Not enough arguments. Needs 1-2, password, digest | |
| Traceback (most recent call last): | |
| File "test1.py", line 32, in <module> | |
| raise NotEnoughArgumentsError(requires, arguments) | |
| <unknown>NotEnoughArgumentsError: (1, ['password', 'digest']) |
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
| import hashlib | |
| def mkpasswd(self, irc, msg, args, password, digest): | |
| """<password> [digest] | |
| Hashes the password into the chosen digest. / Uses sha256 if digest isn't given explicitly.""" | |
| if digest == None: | |
| m = hashlib.sha256() | |
| m.update(b'%s' % password.encode('utf-8')) | |
| m.digest | |
| result = m.hexdigest() | |
| irc.reply(result, private=True, notice=True) |
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
| post "/commit/?" do | |
| config = YAML.load(File.open("gl-bot.yaml", "r")) | |
| Thread.new do | |
| socket = TCPSocket.open(config["host"], config["port"]) | |
| socket.puts("NICK #{config["nick"]}") | |
| socket.puts("USER #{config["nick"]} 8 * : #{config["realname"]}") | |
| #socket.puts("JOIN #{IRC_CHANNEL}") # don"t join, just send the msg directly -- make sure the channel is /mode -n | |
| # Don"t send anything to the channel until we"ve been successfully authorized by the IRC server to do so | |
| while line = socket.gets | |
| if line.include? "376 #{config["nick"]}" |
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
| ken@ken:~/Documents$ ruby perdiem.rb | |
| Insert dates. (dd/mm/yyyy) | |
| starting date... | |
| 01/01/1970 | |
| ending date... | |
| 01/01/1971 | |
| 365 |
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
| ken@e-code:~/b$ ./xboxdrv.rb -v -d --pid ~/xboxdrv.pid --game "Super Hexagon" --configs 221640 | |
| Blehk... | |
| #<OpenStruct verbose=true, daemon=true, pid="/home/ken/xboxdrv.pid", config=nil, configs="/home/ken/.xbox-configs/configs/", gamesfile="/home/ken/.games.json", mouse=true, game=221640, config_list=["221640"]> | |
| Will be verbose! | |
| Will run as a daemon | |
| Will write a pid file | |
| exec 'steam://run/221640' | |
| -v -D --pid /home/ken/xboxdrv.pid --config /home/ken/.xbox-configs/configs/mouse.xboxdrv --alt-config /home/ken/.xbox-configs/configs/221640.xboxdrv -- |
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
| ken@e-code:~/$ ./xboxdrv.rb -v -d --pid ~/xboxdrv.pid --game "Super Hexagon" | |
| Blehk... | |
| #<OpenStruct type=[], verbose=true, daemon=true, pid="/home/ken/xboxdrv.pid", config=nil, configs="/home/ken/.xbox-configs/configs/", gamesfile="/home/ken/.games.json", mouse=true, game=221640> | |
| Will be verbose! | |
| Will run as a daemon | |
| Will write a pid file | |
| -v -D --pid /home/ken/xboxdrv.pid |