Skip to content

Instantly share code, notes, and snippets.

View p-alik's full-sized avatar

Alexei Pastuchov p-alik

View GitHub Profile
@p-alik
p-alik / ghcPkgUtils.sh
Last active February 2, 2020 19:38 — forked from timmytofu/ghcPkgUtils.sh
ghc-pkg-clean and ghc-pkg-reset compatible with both zsh and bash
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.
@p-alik
p-alik / cli requests to cardano-sl api
Last active September 10, 2020 07:36
list accounts, list wallet transactions history
# https://cardanodocs.com/technical/wallet/api/
# create a new wallet
$ curl -H "Content-Type: application/json" --cacert cardano-sl/scripts/tls-files/ca.crt https://localhost:8090/api/wallets/new -d '{
"cwInitMeta": {
"cwName": "my-cardano-wallet",
"cwAssurance": "CWAStrict",
"cwUnit": 0
},
"cwBackupPhrase": {
This file has been truncated, but you can view the full file.
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.eclipse.jetty:jetty-distribution:pom:9.4.13-SNAPSHOT
[WARNING] 'build.plugins.plugin.(groupId:artifactId)' must be unique but found duplicate declaration of plugin org.apache.maven.plugins:maven-dependency-plugin @ org.eclipse.jetty:jetty-distribution:[unknown-version], /opt/devel/workspace/java/jetty.project/jetty-distribution/pom.xml, line 140, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
@p-alik
p-alik / otrs-ticket-search.pl
Created March 18, 2019 16:47
Trace OTRS TicketSearch Request
use v5.10;
use strict;
use warnings;
use SOAP::Lite (+trace => "all");
my $proxy = "https://domain/otrs/rpc.pl";
my $soap = SOAP::Lite->new(proxy => $proxy);
my ($user, $pw) = (qw/foo bar/);
@p-alik
p-alik / lib.rs
Last active June 6, 2020 05:24
minimal MySql wundergraph::query_builder::mutations::insert::HandleInsert implementation
use diesel::associations::HasTable;
use diesel::backend::Backend;
use diesel::deserialize::FromSql;
use diesel::dsl::SqlTypeOf;
use diesel::expression::{Expression, NonAggregate, SelectableExpression};
use diesel::insertable::CanInsertInSingleQuery;
use diesel::mysql::Mysql;
use diesel::query_builder::{BoxedSelectStatement, QueryFragment};
use diesel::query_dsl::methods::{BoxedDsl, FilterDsl};
use diesel::r2d2::{ConnectionManager, Pool, PooledConnection};
@p-alik
p-alik / etc-nixos
Last active March 8, 2024 08:33
NixOS config on Dell XPS 13 Plus 9320
# /etc/nixos/configuration.nix
{ config, pkgs, ... }:
{
imports =
[
./hardware-configuration.nix
];
boot.loader.systemd-boot.enable = true;