Skip to content

Instantly share code, notes, and snippets.

View mfilipe's full-sized avatar

Michel Filipe mfilipe

View GitHub Profile
@mfilipe
mfilipe / .zshrc
Created October 25, 2023 20:01
Alias for VFIO
# VFIO
alias gpu-bind="sudo driverctl set-override 0000:03:00.0 amdgpu && sudo driverctl set-override 0000:03:00.1 snd_hda_intel"
alias gpu-unbind="sudo driverctl unset-override 0000:03:00.0 && sudo driverctl unset-override 0000:03:00.1"
alias cpu-bind="sudo systemctl set-property --runtime -- system.slice AllowedCPUs=0-15 &&
sudo systemctl set-property --runtime -- user.slice AllowedCPUs=0-15 &&
sudo systemctl set-property --runtime -- init.scope AllowedCPUs=0-15"
alias cpu-unbind="sudo systemctl set-property --runtime -- system.slice AllowedCPUs=0,1,2,3,8,9,10,11 &&
sudo systemctl set-property --runtime -- user.slice AllowedCPUs=0,1,2,3,8,9,10,11 &&
sudo systemctl set-property --runtime -- init.scope AllowedCPUs=0,1,2,3,8,9,10,11"
This file has been truncated, but you can view the full file.
Mar 27 00:00:26.000 [notice] Tor 0.4.7.13 opening new log file.
Mar 27 00:00:26.000 [info] options_commit_listener_transaction(): Recomputed OOS thresholds: ConnLimit 1000, ConnLimit_ 65504, ConnLimit_high_thresh 65440, ConnLimit_low_thresh 49128
Mar 27 00:00:26.000 [debug] tor_disable_debugger_attach(): Attempting to disable debugger attachment to Tor for unprivileged users.
Mar 27 00:00:26.000 [debug] parse_addr_policy(): Adding new entry 'accept 192.168.13.0/24'
Mar 27 00:00:26.000 [debug] parse_addr_policy(): Adding new entry 'reject *'
Mar 27 00:00:26.000 [info] tor_addr_parse_mask_ports(): '*' expands into rules which apply to all IPv4 and IPv6 addresses. (Use accept/reject *4:* for IPv4 or accept[6]/reject[6] *6:* for IPv6.)
Mar 27 00:00:26.000 [debug] parse_addr_policy(): Adding new entry 'reject *:*'
Mar 27 00:00:26.000 [info] tor_addr_parse_mask_ports(): '*:*' expands into rules which apply to all IPv4 and IPv6 addresses. (Use accept/reject *4:* for IPv4 or accept[6]/reject[6] *6:* for IPv6.)
Mar 27
Mar 08 15:50:49 raspberrypi tor[18252]: Mar 08 15:50:49.912 [notice] Tor 0.4.7.13 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.2, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.4.8 and Glibc 2.35 as libc.
Mar 08 15:50:49 raspberrypi tor[18252]: Mar 08 15:50:49.913 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/
Mar 08 15:50:50 raspberrypi tor[18253]: Mar 08 15:50:50.116 [notice] Tor 0.4.7.13 running on Linux with Libevent 2.1.12-stable, OpenSSL 3.0.2, Zlib 1.2.11, Liblzma 5.2.5, Libzstd 1.4.8 and Glibc 2.35 as libc.
Mar 08 15:50:50 raspberrypi tor[18253]: Mar 08 15:50:50.116 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://support.torproject.org/faq/staying-anonymous/
Mar 08 15:50:50 raspberrypi Tor[18253]: We compiled with OpenSSL 30000020: OpenSSL 3.0.2 15 Mar 2022 and we are running with OpenSSL 30000020: 3.0.2. These two versions should be binary compatible.
Mar 08 15:50:50 raspberrypi Tor[18
tasks["Umbrella"] = {
reportTime("Umbrella Rubocop") {
echo "Run rubocop for umbrella and component generator files"
dockerRunApp(compose.fullImageName(), "bin/rubocop --parallel --config .rubocop_ci.yml")
}
reportTime("Umbrella Tests") {
dockerRunApp(
compose.fullImageName(),
"bash -lc 'bin/schema && bin/test && bin/yard doc'",
"--env RAILS_ENV=test --env DATABASE_NAME=umbrella --env REDIS_LOGICAL_DB_NAME=${testComponentNames.size() + 2}"
- name: Change instance type
include_tasks: _change_instance_type.yml
loop: "{{ instance_types }}"
loop_control:
loop_var: instance_type
vars:
instance_id: "{{ ec2_info.instances[0].instance_id }}"
when: instance_types is defined
@mfilipe
mfilipe / .htaccess
Created May 17, 2017 15:07
apache htaccess config
AuthLDAPURL ldaps://ldap.company.com:636/o=company.com?mail?sub?(objectclass=person)
AuthBasicProvider ldap
AuthzLDAPAuthoritative on
AuthName "Company Intranet Password"
AuthType basic
require ldap-group cn=Internal CGI,ou=memberlist,ou=companygroups,o=company.com
@mfilipe
mfilipe / command-line
Created May 17, 2017 15:00
ldapwhoami
ldapwhoami -H "ldaps://ldap.company.com:636/o=company.com?mail?sub?(&(objectclass=person)([email protected]))" -v
ldap_initialize( ldaps://ldap.company.com:636/o=company.com?mail?sub?(&(objectclass=person)([email protected])) )
SASL/DIGEST-MD5 authentication started
Please enter your password:
ldap_sasl_interactive_bind_s: Protocol error (2)
@mfilipe
mfilipe / test.py
Created May 16, 2017 22:40
pyldap test
import ldap
ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap.OPT_X_TLS_ALLOW)
conn = ldap.initialize('ldaps://ldap.company.com:636')
conn.protocol_version = ldap.VERSION2
conn.simple_bind_s('[email protected]', 'password')
reply = redisCommand(redis_conn, "SETEX inspect:%s %d %b", container_id, 60*2, inspect_result,
strlen(inspect_result));
// freeReplyObject(reply);
if (redisGetReply(redis_conn, reply)==REDIS_OK) {
logger_log("transmit_container_inspect joined\n");
freeReplyObject(reply);
} else {
logger_log("transmit_container_inspect redis error %d\n", __LINE__);
return -1;
}
- name: start service
service: name={{service_name}} state=started
when: service_status.stat.exists
register: start_result
tags:
- start
- name: update systemd files
shell: systemctl daemon-reload
when: start_result.failed and 'systemctl daemon-reload' in start_result.msg