Skip to content

Instantly share code, notes, and snippets.

@anddam
anddam / xsrf.interceptor.ts
Last active July 12, 2024 11:07
Angular HttpClientXsrfModule example
import { Injectable } from '@angular/core';
import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest, HttpXsrfTokenExtractor } from '@angular/common/http';
import { Observable } from 'rxjs';
@Injectable()
export class HttpXSRFInterceptor implements HttpInterceptor {
constructor(private tokenExtractor: HttpXsrfTokenExtractor) {
}
DEBUG]2020-06-17 11:19:47 PID 23: _send_build.send() exception: SMTPAuthenticationError(535, b'5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCredentials u4sm8254561wmb.48 - gsmtp')
Your branch is up to date with 'origin/feature-tidy-repository'.
Changes to be committed:
(use "git restore --staged <file>..." to unstage)
modified: cmodules/A
modified: cmodules/B
modified: cmodules/C
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
@anddam
anddam / mwe.py
Last active March 30, 2020 17:00
Programmatically generate pandas plots
import pandas
dataframe = pandas.DataFrame({'A': [1, 2, 3, 4, 6, 5]})
ax = dataframe.plot()
ax.get_figure().savefig('memory-plot.png')
mozjs60-60.8.0_4: configuring ...
mozjs60-60.8.0_4: updated successfully.
p11-kit-0.23.18.1_2: configuring ...
p11-kit-0.23.18.1_2: updated successfully.
p11-kit-32bit-0.23.18.1_2: configuring ...
p11-kit-32bit-0.23.18.1_2: updated successfully.
perl-Glib-Object-Introspection-0.048_2: configuring ...
perl-Glib-Object-Introspection-0.048_2: updated successfully.
python-2.7.17_3: configuring ...
Byte-compiling python code in usr/lib/python2.7...
root 765 1 0 579 736 2 Mar09 ? 00:00:08 runsvdir -P /run/runit/runsvdir/current log: ...........................................................................................................................................................................................................................................................................................................................................................................................................
$ xdot
(xdot:4126): Gtk-WARNING **: 12:59:42.247: Error loading theme icon 'document-open' for stock: Icon 'document-open' not present in theme Adwaita
(xdot:4126): Gtk-WARNING **: 12:59:42.250: Error loading theme icon 'view-refresh' for stock: Icon 'view-refresh' not present in theme Adwaita
(xdot:4126): Gtk-WARNING **: 12:59:42.250: Error loading theme icon 'document-print' for stock: Icon 'document-print' not present in theme Adwaita
(xdot:4126): Gtk-WARNING **: 12:59:42.250: Error loading theme icon 'go-previous' for stock:
(xdot:4126): Gtk-WARNING **: 12:59:42.250: Error loading theme icon 'go-next' for stock:
(xdot:4126): Gtk-WARNING **: 12:59:42.251: Error loading theme icon 'zoom-in' for stock: Icon 'zoom-in' not present in theme Adwaita
(xdot:4126): Gtk-WARNING **: 12:59:42.251: Error loading theme icon 'zoom-out' for stock: Icon 'zoom-out' not present in theme Adwaita
(xdot:4126): Gtk-WARNING **: 12:59:42.251: Error loading theme icon 'zoom-fit-best' for stock: Icon 'zoom-fit-best' not present in t
$ locale
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_NUMERIC=it_IT.UTF-8
LC_TIME=it_IT.UTF-8
LC_COLLATE=C
LC_MONETARY=it_IT.UTF-8
LC_MESSAGES="en_GB.UTF-8"
LC_PAPER=it_IT.UTF-8
anddam@metis:~$ xlocate bin/vpm
xlocate: database outdated, please run xlocate -S.
anddam@metis:~$ xlocate -S
anddam@metis:~$ xlocate bin/vpm
xlocate: database outdated, please run xlocate -S.
anddam@metis:~$
@anddam
anddam / dmesg-excerpt
Last active June 25, 2020 14:01
Traceback in dmesg on A300M-STX board
[ 22.020250] ------------[ cut here ]------------
[ 22.020285] WARNING: CPU: 0 PID: 904 at drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link.c:1738 write_i2c_retimer_setting+0xc5/0x3e0 [amdgpu]
[ 22.020285] Modules linked in: 8021q garp mrp stp llc nls_iso8859_1 nls_cp437 vfat fat snd_hda_codec_realtek edac_mce_amd snd_hda_codec_generic kvm_amd ledtrig_audio ccp iwlmvm rng_core snd_hda_codec_hdmi kvm snd_hda_intel mac80211 irqbypass wmi_bmof snd_intel_nhlt pcspkr sp5100_tco libarc4 k10temp snd_hda_codec i2c_piix4 iwlwifi joydev btusb snd_hda_core r8169 snd_hwdep btbcm input_leds btrtl btintel snd_pcm realtek cfg80211 evdev mac_hid acpi_cpufreq snd_seq snd_seq_device snd_timer snd soundcore vhost_vsock vmw_vsock_virtio_transport_common vsock vhost_net vhost tap uhid hci_vhci bluetooth ecdh_generic rfkill ecc crc16 vfio_iommu_type1 vfio uinput userio ppp_generic slhc tun loop nvram cuse fuse hid_generic usbkbd usbmouse usbhid hid btrfs xor crct10dif_pclmul crc32_pclmul ghash_clmulni_intel amdgpu ahci