Skip to content

Instantly share code, notes, and snippets.

@wnarifin
wnarifin / thinkpad_a485_linux.md
Last active May 23, 2020 13:36
Installing Linux on Lenovo ThinkPad A485

Why

I was unable to boot to live Linux distro to install Linux on my newly bought A485 ThinkPad laptop. Although I was initially dissapointed, I was not alone. This gist documents the information I gathered from the net to complete the installation.

At the time of posting this gist, the issue is still persistent. It might not be relevant anymore once Lenovo release a working BIOS update to resolve the issue. [Update 19/01/2019]: Updating to BIOS 1.14 worked for me.

Sources

The information in this short gist was compiled from several sources. Although most are for E series, it worked for A485:

  1. https://www.reddit.com/r/thinkpad/comments/9ia3e4/linux_on_thinkpad_a485/
  2. https://evilazrael.de/node/401
@eshandas
eshandas / fabfile.py
Last active July 27, 2022 17:08
Fabric 2 file for helping in deployments and other housekeeping tasks
# Fabfile to:
# - update the remote system(s)
# - download and install an application
from fabric import Connection
from fabric import task
import os
import environ
root = environ.Path(__file__) - 1 # one folder back (/manage - 3 = /)
@veuncent
veuncent / create_wagtail_pages_through_migration
Last active August 26, 2021 07:39
Set wagtail (home)pages programmatically during Django Migrations
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
from wagtail.wagtailcore.models import Page, Site
def forwards_func(apps, schema_editor):
HomePage = apps.get_model('website', 'HomePage')
@joepie91
joepie91 / .md
Last active June 10, 2024 14:18
Running a Node.js application using nvm as a systemd service

Read this first!

Hi there! Since this post was originally written, nvm has gained some new tools, and some people have suggested alternative (and potentially better) approaches for modern systems. Make sure to have a look at the comments to this article, before following this guide!


The original article

Trickier than it seems.

@dastergon
dastergon / ec2_info_retriever.py
Last active May 29, 2024 05:17
A basic boto3 based tool for retrieving information from running EC2 instances.
from collections import defaultdict
import boto3
"""
A tool for retrieving basic information from the running EC2 instances.
"""
# Connect to EC2
ec2 = boto3.resource('ec2')
@voluntas
voluntas / webrtc.rst
Last active May 21, 2024 13:55
WebRTC の未来
@miyamoto-daisuke
miyamoto-daisuke / vpc-knowhow-2014-04.template
Last active October 20, 2020 07:02
VPC knownhow 2014-04
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "VPC knowhow template",
"Parameters": {
"KeyName": {
"Description": "Name of an existing EC2 KeyPair to enable SSH access to the instances",
"Type": "String",
"MinLength": "1",
"MaxLength": "64",
"AllowedPattern": "[-_ a-zA-Z0-9]*",
@maepon
maepon / query_plugin_authoring_ja.md
Created February 11, 2013 12:38
プラグイン作成

プラグイン/作成

jQueryを使うことが快適になってきたら、プラグインの作り方を知りたくなるでしょう。それは正解です!プラグインとメソッドでjQueryを利用することは、非常に協力で、さらに、プラグインの中に最も有効な機能を抽象化することで、開発にかける時間を大幅に節約出来ます。この記事は、プラグインを書き始める際の基本的な概要とベストプラクティス、さらに気をつける必要のある一般的な落とし穴についての記事です。

目次

  1. さあはじめよう
  2. コンテキスト
@radmen
radmen / README.md
Created September 10, 2012 08:15
Apache vhost config for gitlab

unicorn config file

Edit file /home/gitlab/gitlab/config/unicorn.rb

Find line listen "#{app_dir}/tmp/sockets/gitlab.socket" and comment it. Uncomment line listen "127.0.0.1:8080"

required modules for apache

  • sudo a2enmod proxy
  • sudo a2enmod proxy_balancer
@runemadsen
runemadsen / description.markdown
Created September 26, 2011 15:23
Reverse polymorphic associations in Rails

Polymorphic Associations reversed

It's pretty easy to do polymorphic associations in Rails: A Picture can belong to either a BlogPost or an Article. But what if you need the relationship the other way around? A Picture, a Text and a Video can belong to an Article, and that article can find all media by calling @article.media

This example shows how to create an ArticleElement join model that handles the polymorphic relationship. To add fields that are common to all polymorphic models, add fields to the join model.