- 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Запросы по сбору статистики 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Вы ранее привлекались за хранение данных в глобальных переменных? | |
Вы когда-нибудь делали .Net за деньги? | |
Сформулируйте зависимость времени исправления критического бага от seniority присутствующего менеджера | |
В своём резюме вы указали знание php. вам не стыдно? | |
Перед вами кисть, холст и мольберт. напишите компилятор |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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'; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* /path/to/migrations/directory/Version20121011141021.php | |
*/ | |
namespace ExampleMigrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
class Version20121011141021 extends AbstractMigration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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/ | |
# |
NewerOlder