Skip to content

Instantly share code, notes, and snippets.

@lilongen
lilongen / 生活小窍门.如何不让电视遥控器能控制灯.电视遥控器可以控制灯的问题
Last active February 14, 2020 10:57
生活小窍门.如何不让电视遥控器能控制灯.电视遥控器可以控制灯的问题
1. 使用几个废弃的遥控器(遥控器得是好的
2. 墙壁开关按到关灯10秒后开灯,开灯3秒内对着灯按遥控器上的任意键,灯自动闪三次后设置成功(有可能没反应, 不过没关系)
3. 再次继续关灯10秒后开灯,开灯3秒内按遥控器上的其他按键
4. 设置4次之后按电视遥控器检测是否有影响
5. 这样设置过后, 之前电视遥控器应该就不能在遥控灯了
@lilongen
lilongen / nested.esxi.vm.vsca.workaround
Created June 27, 2019 10:39
nested.esxi.vm.cannot.access.outside.host
1. install esxi on esxi, need to enable esxi vm cpu option "Hardware virtualization": "Expose hardware assisted virtualization to the guest OS "
2. when nested esxi host vm still not bind into vcenter, will exists this issue
solution: Enabling Promiscuous mode on the network of the physical ESXi host worked
3. when nested esxi host vm managed by vcenter, seems does not exist this issue
@lilongen
lilongen / hue+ldap.auth+issue
Last active May 23, 2019 06:58
hue+ldap.auth+issue
File "/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hue/build/env/lib/python2.7/site-packages/django_auth_ldap-1.2.0-py2.7.egg/django_auth_ldap/config.py", line 159, in execute
filterstr = self.filterstr % filterargs
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe7 in position 73: ordinal not in range(128)
solution/
file:
/opt/cloudera/parcels/CDH-5.14.0-1.cdh5.14.0.p0.24/lib/hue/build/env/lib/python2.7/site-packages/django_auth_ldap-1.2.0-py2.7.egg/django_auth_ldap/config.py
line 155:
filterstr = self.filterstr % filterargs
to
@lilongen
lilongen / df.du.unmatch.inconsistent.solution
Created February 20, 2019 06:00
xfs文件系统, 根分区已满, 占用空间与实际使用空间不符, 使用xfs工具修复
首先安装xfs工具
yum install xfsdump
yum install xfsprogs-devel
yum install xfsprogs
检测/分区的碎片
# xfs_db -c frag -r /dev/vda1
显示的数据是10%左右,尝试使用修复整理碎片
# xfs_fsr /dev/vda1
https://www.jianshu.com/p/e5f46dcf4664
https://blog.csdn.net/sayyy/article/details/78351512
openssl pkcs12 -export -in uydc-101.crt -inkey uydc-101.key -out uydc-101.p12 \
-name uydc-101 -CAfile yxt-ca.crt -caname yxtca -passout pass:123456
openssl pkcs12 -in ydc.p12 -password file:pass -passin file:pass -nokeys
openssl pkcs12 -in ydc.p12 -password file:pass -passin file:pass -nokeys -
keytool -importkeystore -deststorepass 123456 -destkeypass 123456 \
1. config vm to increase disk size
2. for i in /sys/class/scsi_device/*; do echo 1 > $i/device/rescan; done
3. parted /dev/sdb
-- to confirm disk and partion changes and fix change
4. umount -l /sdb
5. parted /dev/sdb resizepart 1 100%
6. mount /sdb
7. xfs_growfs /sdb
@lilongen
lilongen / how.to.configure.supported.browsers.for.Kerberos.and.NTLM
Last active September 8, 2023 15:49
How to configure supported browsers for Kerberos and NTLM
# from https://ping.force.com/Support/PingFederate/Integrations/How-to-configure-supported-browsers-for-Kerberos-NTLM#chrome
How to configure supported browsers for Kerberos and NTLM
Published: 01/25/2018
The PingFederate Integrated Windows Authentication (IWA) Adapter supports the Kerberos and NTLM authentication protocols, but some browsers need to be configured to utilize them. The following guide will define which settings are necessary in each browser.
For Kerberos and NTLM authentication, the PingFederate IWA Adapter utilizes the SPNEGO (Simple and Protected GSS-API Negotiation) mechanism to negotiate either Kerberos or NTLM as the underlying authentication protocol. Each browser below supports SPNEGO, but differences exist that may affect which protocol is negotiated in each instance, due to the combination of browser and OS.
The PingFederate IWA Adapter supports the following browsers:
@lilongen
lilongen / mac.chrome.access.hadoop.secure.webui
Last active April 15, 2022 04:46
macos.chrome.access.hadoop.secure.webui
1.a /etc/krb5.conf
1.b export KRB5_CONFIG=/etc/krb5.conf
2. kinit
3. "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --auth-server-whitelist="*" --auth-negotiate-delegate-whitelist="*"
Issue & solutions:
I_1: Kerberos kinit: Unknown credential cache type while getting default ccache
A: Just comment the attribute default_ccache_name
https://stackoverflow.com/questions/48836113/kerberos-kinit-unknown-credential-cache-type-while-getting-default-ccache
@lilongen
lilongen / simple.fio.test.script.sh
Last active December 26, 2018 03:08
simple.fio.test.script.sh
#!/bin/bash
#
ansible_host=$1
drive=$2
workspace=${drive}/fio
for rw_mode in read write rw randread randwrite randrw; do
for bs in 16k 32k 64k; do
for job_num in 1 2 3; do
@lilongen
lilongen / etc.rsyslog.d.haproxy.conf
Last active December 20, 2018 09:03
haproxy.example.cfg
$ModLoad imudp
$UDPServerRun 514
$FileCreateMode 0644
$FileOwner ha
local0.* /var/log/haproxy.log
local1.* /var/log/haproxy_warn.log