View which ports are open
iptables -vn -LGuide to handle ports: https://phabricator.skroutz.gr/w/doc/uservm/
| ----------------------------------------------------------------- | |
| -- PostgreSQL | |
| -- | |
| SELECT last_value, is_called | |
| FROM :sequence | |
| -- If is_called is false, last_value is 1 and the next ID also 1. | |
| -- If is_called is true, the next ID is last_value + 1 |
| <?php | |
| /** | |
| * Generate datetime with timezone support and microsend precision. | |
| * | |
| * Example: | |
| * ``` | |
| * $now = Datetime::now(); // generates YYYY-MM-DDTHH:MM:SS.MMMMMM | |
| * ``` | |
| * |
| <?php | |
| /** | |
| * Helper class. | |
| * | |
| * This class provides some static methods that are helpful with | |
| * postgres like manually manipulating sequences and dropping | |
| * tables cascaded. | |
| * | |
| * It also provides the ability to create a batch insert (COPY) |
| { | |
| "font_size": 11, | |
| "open_files_in_new_window": true, | |
| "remember_full_screen": true, | |
| "rulers": | |
| [ | |
| 80 | |
| ], | |
| "tab_size": 4, | |
| "translate_tabs_to_spaces": false |
| [ | |
| { "keys": ["ctrl+shift+c"], "command": "toggle_comment", "args": { "block": false } } | |
| ] |
| class Nanotime | |
| def in_seconds(now = ::Time.current) | |
| now.strftime("%s000000000") | |
| end | |
| def in_milliseconds(now = ::Time.current) | |
| now.strftime("%s%3N000000") | |
| end | |
| def in_microseconds(now = ::Time.current) |
| <!doctype html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>The HTML5 Herald</title> | |
| <meta name="description" content="The HTML5 Herald"> | |
| <meta name="author" content="SitePoint"> |
View which ports are open
iptables -vn -LGuide to handle ports: https://phabricator.skroutz.gr/w/doc/uservm/
| # Remove stopped containers | |
| docker rm $(docker ps -a -q) | |
| # Remove untagged images | |
| docker rmi $(docker images -a | grep "^<none>" | awk '{print $3}') |
| bundle exec rbtrace -p $1 -e 'Thread.new{GC.start;require "objspace";io=File.open("/tmp/ruby-heap.dump", "w"); ObjectSpace.dump_all(output: io); io.close}' | |
| bundle exec rbtrace -p $1 -e 'Thread.new{require "memory_profiler"; MemoryProfiler.start}' | |
| bundle exec rbtrace -p $1 -e 'Thread.new{require "memory_profiler"; MemoryProfiler.stop.pretty_print(to_file: "/tmp/memory_profiler.log", detailed_report: true, scale_bytes: true)}' |