Skip to content

Instantly share code, notes, and snippets.

  • Based on https://gist.github.com/mdziekon/221bdb597cf32b46c50ffab96dbec08a
  • Installation date: 16-08-2019
  • Additional notes based on my own experience
  • EFI boot
  • Ubuntu 19.04 -> 21.04
  • This should work on any computer. Only the RAID > AHCI change described below and the device name for the nvme ssd drive are specific to this laptop.
  • The process describes a completely fresh installation with complete repartitioning, however it should work fine when Windows is already installed (eg. brand new machine with Windows preinstalled) as long as Windows already boots with EFI.
  • The process was conducted on Dell's XPS 15 9560 (2017) with specs:
  • CPU: i7-7700HQ
@gotbletu
gotbletu / ocs-sr
Last active April 10, 2024 09:01
Clonezilla ocs-sr commandline options manpage
Clonezilla (v2.5.0) "ocs-sr" Options
(Reformated for easier reading)
To save or restore image
ocs-sr [OPTION] {MODE} IMAGE_NAME DEVICE
Where MODE is one of
savedisk
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active July 14, 2024 19:55
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@alexey-sh
alexey-sh / main.js
Created March 3, 2016 09:18
alfabank currencies
function loadScript () {
return $.getScript('https://cdnjs.cloudflare.com/ajax/libs/Chart.js/1.0.2/Chart.js');
}
function loadData () {
return $.getJSON('https://alfabank.ru/ext-json/0.2/exchange/cash/?offset=0&limit=20').then(function (d) { return d.response.data.usd.filter(function (x) {return x.type==='buy'}); });
}
function drawChart () {
$.when(loadData(), loadScript()).then(function (currencies) {
-- Запросы по сбору статистики PostgreSql 9.3.x
-- Процессы которые висят более 20 секунд
select * from pg_stat_activity where state != 'idle' and current_timestamp - query_start > '20 sec';
-- К-во update-тов за время с последнего сброса статистики
SELECT relname, n_tup_ins + n_tup_upd + n_tup_del from pg_stat_user_tables order by 2 desc limit 5;
-- Сброс статистики
SELECT pg_stat_reset();
@slavcodev
slavcodev / вопросы-для-IT-собеседования
Created June 5, 2014 08:14
Нормальные вопросы для IT-собеседования
Вы ранее привлекались за хранение данных в глобальных переменных?
Вы когда-нибудь делали .Net за деньги?
Сформулируйте зависимость времени исправления критического бага от seniority присутствующего менеджера
В своём резюме вы указали знание php. вам не стыдно?
Перед вами кисть, холст и мольберт. напишите компилятор
@tott
tott / ip_in_range.php
Created November 27, 2013 22:46
php check if IP is in given network range
/**
* Check if a given ip is in a network
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed
* @return boolean true if the ip is in this range / false if not.
*/
function ip_in_range( $ip, $range ) {
if ( strpos( $range, '/' ) == false ) {
$range .= '/32';
}
@priestjim
priestjim / chef-noatime-and-swap.rb
Created November 29, 2012 19:01
A quick (hacky) Chef recipe for adding noatime and a swap file in case a swap file does not exist
# Enable noatime on local ext3/4 & xfs filesystems
fstab = File.open('/etc/fstab',"r")
newlines = Array.new
needremount = Array.new
ihaveswap = false
fstab.each do |line|
# Tokenize each fstab line with a space separator
tokens = line.split
if tokens[2] == "swap"
@ziadoz
ziadoz / Version20121011141021.php
Created October 11, 2012 20:53
Doctrine DBAL and Migrations Example
<?php
/*
* /path/to/migrations/directory/Version20121011141021.php
*/
namespace ExampleMigrations;
use Doctrine\DBAL\Migrations\AbstractMigration;
use Doctrine\DBAL\Schema\Schema;
class Version20121011141021 extends AbstractMigration
@kevinkarwaski
kevinkarwaski / multi_env_knife_config
Created February 18, 2012 19:06
Knife config for Multiple Chef Environments
#
# This is an example of a knife.rb configuration that uses yml and a
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments.
#
# Example usage:
# export CHEF_ENV=evnironment_01
# knife status
#
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/
#