Windows Service with Python 3.5 and pyinstaller
- Python 3.5.x
- Visual C++ Build Tools 2015
- PyInstaller 3.2
ps aux | grep 'httpd' | awk '{print "PID ->" $2 " MEM ->" $6/1024 " MB";}' | |
watch -n 1 "echo -n 'Apache Processes: ' && ps -C httpd --no-headers | wc -l && free -m" | |
ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}' | |
1) process tree | |
pstree -p | grep httpd | |
2) sessions memory | |
ps aux | grep 'httpd' | awk '{print "PID ->" $2 " MEM ->" $6/1024 " MB";}' |
1) copy key to new instance. My-new-key.pem to .ssh | |
2) change permissions (chmod 400) | |
3) run as ec2-user/centos/ubuntu: | |
cd .ssh | |
ssh-keygen -f My-new-key.pem -y >> authorized_keys |
netstat -plnt |
Wow! I Didn't Know You Could Do That In vi | |
compiled by: Patricia Bender | |
ESC = the escape key | |
RET = the return key | |
char = any lowercase character | |
8 = any number | |
num = any number |
This is a quick tldr; there are many other situations and options you could consider. | |
FIO man page | |
IOP/s = Input or Output operations per second | |
Throughput = How many MB/s can you read/write continuously | |
Variables worth tuning based on your situation: | |
--iodepth | |
The iodepth is very dependant on your hardware. |
journalctl | |
This will display the logs with the oldest entries first. Although this is simple, it is not very useful since we do not tend to read logs like a book. | |
By default journalctl displays the logs in a pager. It shows you one page of logs requiring you to hit the space bar to proceed. Also long log lines WILL NOT wrap, they will trail off the right side of the screen. You can use the right arrow to see the rest of the line. | |
We will talk more about changing the way the logs are displayed in a different article. Let's move on to some basic log viewing commands. | |
Diplaying Logs by Date |
--- | |
- name: test if grub configured for noop i/o scheduler | |
command: egrep -q 'elevator=noop' /boot/grub2/grub.cfg | |
register: grub | |
changed_when: no | |
failed_when: grub_test.rc == 2 | |
- name: configure grub for noop i/o scheduler | |
sudo: yes | |
command: grubby --update-kernel=ALL --args=elevator=noop |
#!/usr/bin/env bash | |
set -x -e | |
JUPYTER_PASSWORD=${1:-"myJupyterPassword"} | |
NOTEBOOK_DIR=${2:-"s3://myS3Bucket/notebooks/"} | |
# home backup | |
if [ ! -d /mnt/home_backup ]; then | |
sudo mkdir /mnt/home_backup | |
sudo cp -a /home/* /mnt/home_backup |
# Jupyter configuration # | |
c.NotebookApp.open_browser = False | |
c.NotebookApp.port = 9090 | |
c.NotebookApp.password = u'sha1:somepass' | |
c.Authenticator.admin_users = {'hadoop'} | |
c.LocalAuthenticator.create_system_users = True | |
c.NotebookApp.contents_manager_class = 's3contents.S3ContentsManager' | |
c.S3ContentsManager.bucket_name = 'my-bucket' | |
c.S3ContentsManager.prefix = 'notebooks' |
Windows Service with Python 3.5 and pyinstaller