SSH tunneling and port forwarding snippets and utils
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
| As root: | |
| # pkg_add gnome | |
| # rcctl disable xenodm | |
| # rcctl enable multicast messagebus avahi_daemon gdm | |
| # reboot |
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
| | | | | | | | | | | | | | | | | | | | | |
| | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | | |
| | | | | | | | | | | | | | | | | | | | | |
| -----+-----------------+ |
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 multiprocessing | |
| from time import sleep | |
| def func(): | |
| name = multiprocessing.current_process().name | |
| print("starting of process named: ", name) | |
| sleep(2) | |
| print("exiting process") | |
| if __name__ == '__main__': |
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
| #!/usr/bin/env perl | |
| use Text::CSV; | |
| use Getopt::Long qw/ GetOptionsFromArray :config pass_through /; | |
| use warnings; | |
| use strict; | |
| my $usage = "usage: $0 [-e] < file.csv\n"; | |
| exit main( @ARGV ); |
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
| #! /usr/bin/env python | |
| """ Convert an image (argv[1]) to an ANSI text string (xterm-256color) | |
| Original readme from colortrans.py follows: | |
| Nice long listing of all 256 colors and their codes. Useful for | |
| developing console color themes, or even script output schemes. | |
| Resources: |
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
| '''Python self-contained module maker | |
| Creates a small Python script containing the neccessary complete | |
| modules in a tar.bz2 archive. The generated script unpacks this | |
| and it can be used as a stand-alone script without explicitly | |
| installing the whole module.''' | |
| import os | |
| import sys | |
| import os.path |