Skip to content

Instantly share code, notes, and snippets.

View zdavatz's full-sized avatar
🎯
Focusing

Zeno R.R. Davatz zdavatz

🎯
Focusing
View GitHub Profile
@namgivu
namgivu / ubuntu-make-swap-file.sh
Last active September 10, 2024 12:25
increase swap file size to 8Gb
# ref. https://askubuntu.com/a/1075516/22308
sudo swapoff /swapfile # make all swap off
sudo rm -rf /swapfile # remove the current
# 8Gb = 8 * 1024Mb = 8192 Mb
# 4Gb = 4 * 1024Mb = 4096 Mb
sudo dd if=/dev/zero of=/swapfile bs=1M count=4096 # resize the swapfile to 4Gb
# =
@extremecoders-re
extremecoders-re / qemu-networking.md
Last active November 7, 2024 03:36
Setting up Qemu with a tap interface

Setting up Qemu with a tap interface

There are two parts to networking within QEMU:

  • The virtual network device that is provided to the guest (e.g. a PCI network card).
  • The network backend that interacts with the emulated NIC (e.g. puts packets onto the host's network).

Example: User mode network

@kuboon
kuboon / dispatch.rb.cgi
Last active October 31, 2016 09:41
run Rails app as DRb server and access it from CGI process
#!ruby
require 'drb/drb'
require 'logger'
require "rack"
require 'rack/rewindable_input'
module Dispatch
RAILS_ENV = 'staging'
DRUBY_URI = "druby://localhost:13141"
LOCKFILE = "../tmp/pids/dispatch.pid"
@gabrielemariotti
gabrielemariotti / build.gradle
Last active January 12, 2024 17:41
Use signing.properties file which controls which keystore to use to sign the APK with gradle.
android {
signingConfigs {
release
}
buildTypes {
release {
signingConfig signingConfigs.release
}
@johnsome
johnsome / gist:873699
Created March 17, 2011 01:34
ruby version date parsing differences and options
Key issue - format of entered dates:
date is displayed like: 31/3/2011
date is input like: 31-3-2011
This is works correctly in ruby 1.8 and 1.9
ruby-1.8.7-p302 > Time.parse '31-3-2011' # => Thu Mar 31 00:00:00 -1000 2011
ruby-1.9.2-p0 > Time.parse('31-3-2011') # => 2011-03-31 00:00:00 -1000
Changes in parsing dates for ruby 1.9:
* no longer has difference in parsing dates with dash or forward slash - they are always in euro format