Archive

Archive for the ‘Uncategorized’ Category

C# || .ToList() in .NET2.0

December 29, 2016 Leave a comment

Sometimes it is necessary to code with old framework, like 2.0.
It hasn’t .ToList() extension method for IEnumerable objects.

well, here it is :

static  public List<tsource>  ToList<tsource>(this IEnumerable<tsource> source)
{
IEnumerator<tsource> en = source.GetEnumerator();
List<tsource> list = new List<tsource>();
en.Reset();
while (en.MoveNext())
{
list.Add(en.Current);
}
return list;
}
bt_code_init('4df0288a-c0e9-48fe-ae6f-71460ffeb895');

Categories: Uncategorized

Raspberry Pi 3 totally headless setup with VNC @ WiFi

December 29, 2016 Leave a comment

Long time since last post.
Some notes here :

Objective : setup RPi 3 without the need for external display nor keyboard.

1. get NOOBS (2.1.0 used here)
2. format SD card as FAT (full capacity) – SDFormatterv4.zip used
3. extract NOOBS zip content to root dir of SD card
4. prepare wpa_supplicant.conf with your WiFi access details, then save it to root dir of SD card along other NOOBS files
Like this:

# /etc/wpa_supplicant/wpa_supplicant.conf

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="YOUR_SSID"
psk="YOUR_WIFI_PASSWORD"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}

5. edit with unix-text-file compatible editor (like Cream gvim) file on SD card :
/os/Raspbian/partition_setup.sh

insert somewhere in the middle line :

if [ -e /settings/wpa_supplicant.conf ] ; then cp /settings/wpa_supplicant.conf /tmp/2/etc/wpa_supplicant/wpa_supplicant.conf ; fi

6. Have TightVNC or RealVNC installed on your PC/Mac.
7. Insert SD Card into RaspberryPi3 and power it on
8. Find IP of your RPi3 – easiest way -> look at website of your router (RPi3 should be named “recovery”)
9. Insert IP address into VNC viewer soft, and you’ll probably get ERROR 10061 – connection refused – that’s because you’re too late right now. NOOBS VNC connection server will be available only for few seconds after RPi bootup.
10. Power down your RPi3 (pull the power plug)
11. Tap connect on your VNC viewer and simultaneously power on RPi3 now – it should connect right now – you’ll see NOOBS installer with available options…

Howgh.

Of courseĀ there is one another problem – how to run headlessly raspi-config after successful install of Raspbian lite … šŸ˜‰

EDIT: To allow SSH into newly installed system, you have to :
1. Put empty file named “ssh” (no extension) into root dir of your SD card (‘boot’ FAT-volume)

and it works great !

Categories: Uncategorized

PCD8544 | a command not very documented…

October 1, 2013 Leave a comment

Today I was getting some old nokia 3310 LCD back alive and found one kind of weird acting. The display was scrolled up by few lines. I get through datasheet but nothing useful seems to be found at first sight. Getting fed with it I wrote few lines to play over undocumented ones, or I should rather say, reserved commands.
The one I was looking for was obviously the last. (Hail to the Murphy!).
Switching the extended instruction set write(0x21,pin_DC=0) gives you access to 0x40 command, which presents analogy to its normal-instruction-set counterpart.
So, write(0x40 | y_offset,pin_DC=0) gives you Y-scroll or Y-shift command, in single line units.
Seems that controller has more than expected amount of DDRAM…

Cheers!

Categories: Uncategorized

JewelryBox & Mac OS X 10.8.3 – solutions…

September 27, 2013 Leave a comment

First of all, you need to have password for your user account. (It may seems silly, but it is required by sudo.
Then you have to sudo nano /etc/sudoers file and add line Defaults !requiretty.
Obviously install XCode 4.3+ and command_line_tools from Apple Dev.
After those simple steps, install & run JewelryBox and pick the right ruby you want.

Categories: Uncategorized Tags:

RFM22 Library update

December 14, 2012 7 comments

Greets,

During development of my tools and toys, RFM22 library evolved slightly. Still, it isn’t very commented, it lacks proper code partition into *.h and *.c, but it works (this is the one and only value I can find). Sorry. I’m providing it without any guarantee. Use it as it is, or as a reference, addressing functional details.

Here’s linkĀ  : ftp://83.143.101.132/RFM22.ZIP

Categories: Uncategorized Tags: , ,

PICKIT3 or PICKIT3-Clone ?

September 19, 2010 Leave a comment

It looks like it is first Microchip programmer/debugger to be in very,very reasonable price.
Although, there is many bad opinions over the Net about it, I think I’m gonna give it a chance, because it looks promising.

I’ve did some math about PICKIT3 price (~200PLN = ~$65 in Poland incl. taxes).
Making it DIY at home : parts : ~100PLN + case ~10PLN + PCB (homemade two-sided) ~ 5PLN + 2-3 days of work + 2-3 days of getting it working …. ehhh….

I only hoping it is worth this cash, and it will be significantly faster than ICD-2…

Categories: Uncategorized

Arrrgghh…

September 14, 2010 Leave a comment

These board-to-board connectors are making me sick…

You left everything working at the evening and in the morning next day the lcd is dead… and you never know if it is code or your connector…

These connectors are one-timers…

Categories: Uncategorized