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
| #!/bin/bash | |
| echo "CPU: $(grep 'model name' /proc/cpuinfo | head -1 | awk -F: '{print $2}')" | |
| echo "Network Interfaces: $(ls -d /sys/class/net/eth* | wc -l) port" | |
| echo "RAM: $(grep MemTotal /proc/meminfo | awk -F: '{print $2}' | sed -e 's/^[[:space:]]*//')" | |
| #echo "RAM: $(grep MemTotal /proc/meminfo | awk '{print $2}' | xargs -I {} echo "scale=4; {}/1024^2" | bc) GB" | |
| echo "Total Disk: $(df -h | sed -n 2p | awk '{print $2}')" | |
| echo "Number Disk: $(df -h | grep "/dev/" | wc -l)" |
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
| check process rabbitmq-server matching "/usr/lib/erlang/erts-6.2/bin/beam" | |
| group rabbitmq | |
| start program = "/etc/init.d/rabbitmq-server start" | |
| stop program = "/etc/init.d/rabbitmq-server stop" | |
| if failed port 5672 type tcp then restart | |
| if 3 restarts within 3 cycles then timeout |
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
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety main restricted | |
| # | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-security main restricted | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-security universe | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-security multiverse | |
| # | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-proposed main restricted | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-proposed universe | |
| deb http://mirror-fpt-telecom.fpt.net/ubuntu/ yakkety-proposed multiverse | |
| # |
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
| '-------------------------------- | |
| ' Split a file into smaller chunks | |
| ' Last Update: 20161130 | |
| ' CmdLine: {this-script} {path to big file} {size in KB} {output} | |
| '-------------------------------- | |
| LF = Chr(10) | |
| Dim oFSO, FullName, Path, Name, Size, TargetDir | |
| Set oFSO = CreateObject("Scripting.FileSystemObject") | |
| 'Set stdout = oFSO.GetStandardStream (1) |
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
| Using Windows Installer | |
| Windows Installer Features | |
| Python 2.5 is distributed as a Microsoft Installer (MSI) file on Windows. Typically, packages are installed by double-clicking them in the file explorer. However, with the msiexec.exe command line utility, additional features are available, like non-interactive installation and administrative installation. | |
| Non-interactive Installation | |
| With the command line | |
| msiexec /i python<version>.msi | |
| installation can be initiated programmatically. Additional parameters can be passed at the end of this command line, like | |
| msiexec /i python-2.5.msi TARGETDIR=r:\python25 | |
| Limited user interface |
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
| #!/bin/bash | |
| # | |
| # | |
| # | |
| function create_cron(){ | |
| new_entry="$1" | |
| if ! crontab -l | fgrep -q "$new_entry"; then | |
| TMP_CRON="/tmp/allcrons" | |
| #write out current crontab |
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
| https://news.ycombinator.com/item?id=13823979 | |
| https://github.com/donnemartin/system-design-primer | |
| https://github.com/donnemartin/interactive-coding-challenges |
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
| def getWays(n, c): | |
| # Complete this function | |
| m = len(c) | |
| # table will contains "cache" | |
| # table[i, j] ~ change number i by first j coins (coins array should be sorted firstly) | |
| table = [ [0 for j in range(m)] for i in range(n + 1) ] | |
| for i in range(n+1): | |
| for j in range(m): | |
| if i == 0: |
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
| def ransom_note(magazine, ransom): | |
| if len(magazine) < len(ransom): | |
| return False | |
| dict_magazine = dict() | |
| dict_ransom = dict() | |
| for word in magazine: | |
| if word not in dict_magazine: | |
| dict_magazine[word] = 1 |
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
| Security Onion | |
| Aug 2014: | |
| ... my purpose for installing this was to: | |
| - learn more about security stuff | |
| - steal the packet captures (pcap) provided so I can replay them using tcpreplay for snort testing, | |
| as it's not so sexy to just test using ICMP ping data or local rules that match anything | |
| see: | |
| http://blog.securityonion.net/ |