Skip to content

Instantly share code, notes, and snippets.

🕶️
Loading...

Austin Walters lettergram

🕶️
Loading...
View GitHub Profile
@lettergram
lettergram / grub
Created Jul 24, 2020
/etc/default/grub
View grub
# Resume UUID set to enable hybernation, will write RAM to swap
GRUB_CMDLINE_LINUX_DEFAULT="resume=UUID=<PARTITION UUID> loglevel=3 quiet"
@lettergram
lettergram / sleep.conf
Created Jul 24, 2020
/etc/systemd/sleep.conf
View sleep.conf
[Sleep]
suspend=suspend-then-hibernate
HibernateState=disk
# Suspend then Hibernate after 45 min
HibernateDelaySec=2700
@lettergram
lettergram / logind.conf
Last active Jul 24, 2020
/etc/systemd/logind.conf
View logind.conf
[Login]
HandlePowerKey=suspend-then-hibernate
HandleLidSwitch=suspend-then-hibernate
@lettergram
lettergram / powertop.service
Last active Jul 24, 2020
/etc/systemd/system/powertop.service
View powertop.service
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
View Parse-USPTO-XML.py
publication_title = bs.find('invention-title').text
publication_num = bs['file'].split("-")[0]
publication_date = bs.find('publication-reference').find('date').text
application_type = bs.find('application-reference')['appl-type']
classifications = []
for classes in bs.find_all('classifications-ipcr'):
for el in classes.find_all('classification-ipcr'):
cclassifications.append(el.find('section').text
+ el.find('class').text
View Parse-USPTO-Patents.py
# Load USPTO .xml document
xml_text = html.unescape(open(filename, 'r').read())
# Split out patent applications / grants
for patent in xml_text.split("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"):
# Skip if it doesn't exist
if patent is None or patent == "":
continue
View elasticbeanstalk_install_webpack.config
container_commands:
01_install_webpack:
command: npm install --save-dev webpack
02_precompile:
command: bundle exec rake assets:precompile
View fix_elasticbeanstalk_for_rails6.config
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y"
02_download_nodejs:
command: "curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -"
03_install_nodejs:
command: "yum -y install nodejs"
04_mkdir_webapp_dir:
command: "mkdir /home/webapp"
@lettergram
lettergram / precompile.config
Last active Nov 3, 2019
precompile assets for ebextensions
View precompile.config
container_commands:
command: bundle exec rails assets:precompile
@lettergram
lettergram / upgrade_nodejs.config
Last active Nov 3, 2019
Upgrade NodeJS on ElasticBeanstalk
View upgrade_nodejs.config
commands:
01_install_yarn:
command: "sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /etc/yum.repos.d/yarn.repo && curl --silent --location https://rpm.nodesource.com/setup_6.x | sudo bash - && sudo yum install yarn -y"
02_download_nodejs:
command: curl --silent --location https://rpm.nodesource.com/setup_8.x | sudo bash -
03_install_nodejs:
command: yum -y install nodejs
You can’t perform that action at this time.