Skip to content

Instantly share code, notes, and snippets.

View lettergram's full-sized avatar
🕶️
Loading...

Austin Walters lettergram

🕶️
Loading...
View GitHub Profile
@lettergram
lettergram / grub
Created July 24, 2020 13:34
/etc/default/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 July 24, 2020 04:34
/etc/systemd/sleep.conf
[Sleep]
suspend=suspend-then-hibernate
HibernateState=disk
# Suspend then Hibernate after 45 min
HibernateDelaySec=2700
@lettergram
lettergram / logind.conf
Last active July 24, 2020 04:33
/etc/systemd/logind.conf
[Login]
HandlePowerKey=suspend-then-hibernate
HandleLidSwitch=suspend-then-hibernate
@lettergram
lettergram / powertop.service
Last active July 24, 2020 04:00
/etc/systemd/system/powertop.service
[Unit]
Description=Powertop tunings
[Service]
Type=oneshot
ExecStart=/usr/bin/powertop --auto-tune
[Install]
WantedBy=multi-user.target
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
# 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
@lettergram
lettergram / elasticbeanstalk_install_webpack.config
Created November 3, 2019 05:44
ebextension to install webpack
container_commands:
01_install_webpack:
command: npm install --save-dev webpack
02_precompile:
command: bundle exec rake assets:precompile
@lettergram
lettergram / fix_elasticbeanstalk_for_rails6.config
Last active May 5, 2022 03:44
ebextension to enable rails 6
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 November 3, 2019 05:34
precompile assets for ebextensions
container_commands:
command: bundle exec rails assets:precompile
@lettergram
lettergram / upgrade_nodejs.config
Last active November 3, 2019 05:35
Upgrade NodeJS on ElasticBeanstalk
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