Skip to content

Instantly share code, notes, and snippets.

@umpirsky
umpirsky / ubuntu-raid.sh
Last active April 15, 2024 00:53
Install Ubuntu on RAID 0 and UEFI/GPT system
# http://askubuntu.com/questions/505446/how-to-install-ubuntu-14-04-with-raid-1-using-desktop-installer
# http://askubuntu.com/questions/660023/how-to-install-ubuntu-14-04-64-bit-with-a-dual-boot-raid-1-partition-on-an-uefi%5D
sudo -s
apt-get -y install mdadm
apt-get -y install grub-efi-amd64
sgdisk -z /dev/sda
sgdisk -z /dev/sdb
sgdisk -n 1:0:+100M -t 1:ef00 -c 1:"EFI System" /dev/sda
sgdisk -n 2:0:+8G -t 2:fd00 -c 2:"Linux RAID" /dev/sda
@umpirsky
umpirsky / userContent.css
Last active November 2, 2023 17:19
Firefox dark theme workaround (https://bugzilla.mozilla.org/show_bug.cgi?id=519763) Inspired by https://wiki.archlinux.org/index.php/Firefox#Unreadable_input_fields_with_dark_GTK.2B_themes. Add it to ~/.mozilla/firefox/xxxxxxxx.default/chrome/userContent.css or using https://addons.mozilla.org/en-US/firefox/addon/stylish/ add-on. add-on.
input:not(.tactile-searchbox-input):not(.urlbar-input):not(.textbox-input):not(.form-control):not([type='checkbox']) {
-moz-appearance: none !important;
background-color: white;
color: black;
}
#downloads-indicator-counter {
color: white;
}
object(stdClass)[757]
public '__CLASS__' => string 'Symfony\Component\Security\Core\SecurityContext' (length=47)
public 'token' =>
object(stdClass)[736]
public '__CLASS__' => string 'Symfony\Component\Security\Core\Authentication\Token\RememberMeToken' (length=68)
public 'key' => string 'eUodAjYEzDza72' (length=14)
public 'providerKey' => string 'main' (length=4)
public 'accessDecisionManager' =>
object(stdClass)[739]
public '__CLASS__' => string 'Symfony\Component\Security\Core\Authorization\AccessDecisionManager' (length=67)
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
@echo off
taskkill/im TokenUtil.exe /f
ECHO U TOKU JE RESTART SERVISA SMARTCARD (SCardSvr)
NET STOP SCardSvr
NET STOP CryptSvc
ECHO U TOKU JE RESTART Cryptographic Services (CryptSvc)
NET START CryptSvc
NET START SCardSvr
cd C:\Program Files\TrustEdgeID\
start TokenUtil.exe
@umpirsky
umpirsky / list.md
Last active April 23, 2021 10:10
Symfony e-commerce solutions.
@umpirsky
umpirsky / TokenBasedRememberMeServices.php
Created September 20, 2019 08:59
Workaround to prevent remember me login BC issue https://github.com/symfony/symfony/issues/33473
<?php
namespace Umpirsky\MyBundle\Security\Http\RememberMe;
use Symfony\Component\Security\Http\RememberMe\TokenBasedRememberMeServices as BaseTokenBasedRememberMeServices;
use Symfony\Component\HttpFoundation\Cookie;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\User\UserInterface;
<?php
/**
* @Assert\Callback(methods={"validateFile"})
*/
class File
{
public function validateFile(ExecutionContext $context)
{
if (null !== $this->getId()) {
<?php
private function getErrorMessages(\Symfony\Component\Form\Form $form) {
$errors = array();
foreach ($form->getErrors() as $key => $error) {
$errors[$key] = $error->getMessage();
}
if ($form->hasChildren()) {
foreach ($form->getChildren() as $child) {
@umpirsky
umpirsky / Application.php
Created November 2, 2012 14:40
Enable query logging for Doctrine in Silex
<?php
if ($this['debug']) {
$logger = new DebugStack();
$this->extend('doctrine_orm.configuration', function(Configuration $configuration) use ($logger) {
$configuration->setSQLLogger($logger);
return $configuration;
});