Showing posts with label geekery. Show all posts
Showing posts with label geekery. Show all posts

Mar 9, 2017

just paste my text!

It's very annoying when sites/applications block copy-paste out of some idiotic conclusion that it improves system security. Here is a novel idea - make it a configuration option.
In a mean time here is a script that I've adopted from https://github.com/EugeneDae/Force-Paste
I've added delay that allows me to switch between applications to Copy and then later Paste.

Enjoy.

Jan 11, 2016

Using Gmail as SMTP host for YouTrack

Unless you're comfortable with using your personal gmail account, create a new account that will be used only for sending notifications from YouTrack.
Open YouTrack administrative settings, and enable Email:

SMTP hostsmtp.gmail.com
SMTP port465
Mail protocolSMTP+SSL
SMTP loginname@host
SMTP passwordpAsSwOrD
Server 'from' email name@host

Try sending a test email, if your server is not running from the same IP/Area from where you initially logged into the gmail account test will fail. The error message suggests to use browser to login, but in my case YouTrack is running on headless minimalistic remote server, installing a browser and all it dependencies would bloat the machine. SSH SOCKS proxy to the rescue!
ssh -D 2222 user@yourserver
This will create a local listening port 2222 on your desktop that can be used to proxy your browser through the server that runs YouTrack.
Set your favorite browser to use this temporary proxy, on FireFox it can be done by navigating to "about:config" and setting the following fields:

network.proxy.socks127.0.0.1
network.proxy.socks_port2222
network.proxy.type1

Verify that your settings are correct by checking your browser IP address, and then login to GMail through the proxy.  Now the test email should go through.

Jul 12, 2013

Running LTspice IV on OSX

UPDATE:
As Helmut Sennewald mentioned in comments, Linear published OSX native version of LTSpice - http://www.linear.com/designtools/software/#LTspice



The following information will be useful only for older OSX versions.

Originally I considered using MacSpice, but unfortunately it lacks UI to draw circuits, and I don't see a reason to be limited to console input.
LTspice is a Windows program, and hence cannot natively run on OSX. WINE software can emulate Windows good enough for some programs to run, and luckily LTspice is one of them. There is more than one way to skin a cat, but I used MacPorts:
sudo port install wine
This runs for a while, and requires XCode. When WINE installation is complete, download LTspice, and launch the installer via WINE:
wine LTspiceIV.exe
Launching the actual program:
wine ~/.wine/drive_c/Program\ Files/LTC/LTspiceIV/scad3.exe


Jun 16, 2013

Raspberry Pi serial communication

Since I was tinkering with Pi network settings, sometimes I was loosing SSH connectivity.
Annoying process of hooking Pi to display and keyboard forced me to look for a serial connection option. This way I will just have to switch between two terminal windows, instead of messing with the cables.
I've got a dongle named "USB 2.0 to TTL Uart 5-Pin CP2102 Module Serial Converter", based on reviews it should work in this configuration.

Jun 14, 2013

Raspberry Pi with RT5370 Wireless Adapter

My PI worked flawlessly for some time hooked up to ethernet, but I wanted to move it away from router, and for this I bought some noname wifi dongle. After hooking it up, I run lsusb and it showed up as:
ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
Google told me that it should work out of the box. I used vanilla configuration:

/etc/network/interfaces
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface default inet dhcp

/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
update_config=1
network={
        ssid="MYSSID"
        scan_ssid=1
        mode=0
        proto=WPA2
        auth_alg=OPEN
        pairwise=CCMP
        group=CCMP
        key_mgmt=WPA-PSK
        psk="MYPASSWORD"
}
The system behaved weirdly, it worked for some time with very sluggish connection speed, but most of the times, ssh connections where just timing out. People complaining about unstable performance, where told to hook it through powered USB hub, since it is possible that power supply on Raspberry cannot produce enough power.

Mar 24, 2013

Raspberry Pi emulator on OSX

I've ordered Raspberry Pi computer, but it didn't arrive yet, so I decided to try out the OS image provided from their site: http://www.raspberrypi.org/downloads.

I've found multiple articles on the net on how to do it on OSX, they all boil down to:

Get yourself qemu ARM software (in my case: sudo port install qemu +target_arm)
Get qemu ARM kernel from here.
Get wheezy image from raspberry site.
Launch:
qemu-system-arm -kernel kernel-qemu -cpu arm1176 -m 256 -M versatilepb -no-reboot -serial stdio -append "root=/dev/sda2 rootfstype=ext4 elevator=deadline rootwait panic=1" -hda 2013-02-09-wheezy-raspbian.img -redir tcp:5022::22

On my system with qemu 1.4.0 this image hangs after printing few SCSI timeout erros.
Commenting out /etc/ld.so.preload did not help, instead of SCSI errors i got kernel panic.
But soft-float image: 2012-08-08-wheezy-armel.zip.torrent works as expected.

After booting, you can access shell with ssh localhost -p 5022.