Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| import re | |
| f = open("data.csv", "r") | |
| lines = f.readlines() | |
| regex = '\[(.*?)\] "(.*?)" (\d+) (\d+)' | |
| l = [] | |
| for line in lines: | |
| path = re.match(regex, line).group(2) | |
| status_code = re.match(regex, line).group(3) |
| import functools | |
| user = {"username": "ahmet", "access_level": "guest" } | |
| def make_secure(access_level): | |
| def decarator(func): | |
| @functools.wraps(func) | |
| def secure_function(*args, **kwargs): | |
| if user["access_level"] == access_level: | |
| return func(*args, **kwargs) |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| version: '2' | |
| services: | |
| postgres: | |
| image: postgres:9.5 | |
| restart: always | |
| environment: | |
| - "POSTGRES_USER=${POSTGRES_USER}" | |
| - "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}" | |
| - "POSTGRES_DB=gogs" | |
| volumes: |
| python main.py --help | |
| usage: main.py [-h] file_name line_number | |
| positional arguments: | |
| file_name filename | |
| line_number number of line | |
| optional arguments: | |
| -h, --help show this help message and exit |
| #!/usr/bin/env python3.6 | |
| message = input("Enter a message: ") | |
| count = input("Number of repeats [1]: ").strip() | |
| if count: | |
| count = int(count) | |
| else: | |
| count = 1 |
| - name: Parse and create dict | |
| set_fact: | |
| user_datas: "{{ user_datas|default({}) | combine( {item.split(':')[0]: item.split(':')[1]} ) }}" | |
| my_list: > | |
| {% set l = [] %} | |
| {% l.append(user_datas) %} | |
| with_items: "{{ user_list }}" |
| [root@test-172-ct20 ~]# puppet agent -t | |
| Info: Using configured environment 'test' | |
| Info: Retrieving pluginfacts | |
| Info: Retrieving plugin | |
| Info: Loading facts | |
| Notice: /Stage[main]/Profile::Monitoring::Nagios/Tidy[tmp_nagios]: Tidying 0 files | |
| Info: Applying configuration version '1506083331' | |
| Notice: /Stage[main]/Profile::Netbackup::Files/File[/opt/openv7c]/ensure: current_value absent, should be directory (noop) | |
| Notice: /Stage[main]/Netbackup::Client::Install/File[install_netbackup_client.expect]/ensure: current_value absent, should be file (noop) | |
| Notice: /Stage[main]/Netbackup::Client::Install/Package[expect]/ensure: current_value purged, should be present (noop) |
| Error: /Stage[main]/Profile::Base/File[/root/hello.txt]: Could not evaluate: Could not retrieve information from environment development source(s) file:/scripts/hello.txt | |
| Notice: /Stage[main]/Profile::Base/Nfs::Client::Mount[/scripts]/Mount[shared 192.168.33.50:/test by localhost.localdomain /scripts]/ensure: ensure changed 'unmounted' to 'mounted' | |
| Info: /Stage[main]/Profile::Base/Nfs::Client::Mount[/scripts]/Mount[shared 192.168.33.50:/test by localhost.localdomain /scripts]: Scheduling refresh of Mount[shared 192.168.33.50:/test by localhost.localdomain /scripts] | |
| Info: Mount[shared 192.168.33.50:/test by localhost.localdomain /scripts](provider=parsed): Remounting | |
| Notice: /Stage[main]/Profile::Base/Nfs::Client::Mount[/scripts]/Mount[shared 192.168.33.50:/test by localhost.localdomain /scripts]: Triggered 'refresh' from 1 events |
| include ::nfs::client | |
| nfs::client::mount { '/scripts': | |
| mount => '/scripts', | |
| server => '192.168.33.50', | |
| share => '/test', | |
| perm => '0755', | |
| options => 'rw,nfsvers=3', | |
| } | |