• Uncategorized
  • humor
  • finance
  • lifehack
  • trends
  • trading
  • culture
  • tech
  • aide-memoire
  • programming

Infinite Curiosity

~ Exploring ideas related to tech, code, finance, markets, adtech, AI, humor and more!

Category Archives: aide-memoire

#iptables forward an IP address to another

15 Wednesday Apr 2015

Posted by Grynn in aide-memoire, programming

≈ Leave a comment

Using #iptables to forward a whole IP address to another (server)

iptables -A PREROUTING -t nat -d $src -j DNAT --to $dst
iptables -A POSTROUTING -t nat -d $dst -j MASQUERADE

Connections from anywhere to $src will get forwarded to $dst (though source IP will be changed to that of eth0 or default outbound device). Useful when moving servers; keeps the old address alive for a bit. Though we lose ‘real’ source address.

For example, if forwarding IP address used by an SMTP server, all email will appear to come from $eth0. If $eth0 (could be the same as $src, but not guaranteed) is privileged, in the sense that it is allowed to relay, then anyone will be able to relay through the SMTP server. But works in a pinch, while DNS changes are propogating through the ‘net.

A somewhat more concrete example. Say you have IP address 1.2.3.4; if you do

iptables -A PREROUTING -t nat -d 1.2.3.4 -j DNAT --to 8.8.8.8
iptables -A POSTROUTING -t nat -d 8.8.8.8 -s 1.2.3.4 -j MASQUERADE

1.2.3.4 is now forwards to Google’s Public DNS Server. You can now use 1.2.3.4 as if it were 8.8.8.8.

Proxmox 1.9 – Resize virtual disk

31 Thursday May 2012

Posted by Grynn in aide-memoire, programming

≈ Leave a comment

I just had to resize a virtual disk and it was harder than I thought; writing down what I did so it’s easy to find …

  1. shutdown VM
    qm shutdown 108
  2. resize disk image
    qemu-img resize vm-108-disk-1.qcow2 +20G
  3. attach pmagic CD; boot to pmagic (using proxmox management web interface)
  4. extend physical partition
    pvdisplay; lvdisplay; 
    fdisk -u=sectors /dev/sda
    delete partition 2 (remember starting sector) (‘d’, 2)
    create new partition (n) starting at same sector as before; end is defaulted
  5. extend pv
    pvresize –v /dev/sda2
  6. extend lv
    lvresize –L +20G VolGroup/lv_root
  7. resize filesystem
    e2fsck –f /dev/sda2
    resize2fs /dev/sda2
  8. detach pmagic cdrom
  9. start VM
    qm start 108

 

Good instructions for working with Windows (NTFS) disk images is here: http://cauldrondevelopment.com/blog/2009/02/26/resize-qemu-ntfs-image/

₹ ₹ ₹ Using the new Indian Rupee Symbol (in Word, Excel etc.)

26 Thursday May 2011

Posted by Grynn in aide-memoire, lifehack, programming

≈ 10 Comments

Microsoft provides updated fonts in a hotfix which is available from here: http://support.microsoft.com/kb/2496898. The hotfix works with Office, Excel, Word and most Windows applications, including browsers.

After installing the hotfix, you can enter unicode characters using “charmap.exe”. In Windows, press the WIN and R keys, type charmap and press enter.

image

charmap

Whether you use the official (Microsoft supplied) hotfix or download a font like Foradian, people who you send your document to, may not have the requisite fonts. Word, Excel, PDF allow you to embed your own fonts, but there’s not much you can do for websites (sure you can do a lot of CSS work and embed your own fonts, but it won’t work with a lot of browsers out there). When sharing docs with people, you can also use the older U+20A8 symbol (₨).

Inserting the older symbol is not much different, and you can use charmap.

image

Old Rupee symbol U+20A8 ₨
New Rupee symbol U+20B9 ₹

 

Another side-effect of installing the hot-fix is that Excel’s “currency format” dropdown now has a Rupee format available:

image

Also see: “Three Ways to enter Unicode characters in Windows”

To use Indian formatting for numbers (i.e. Lakh, Crore instead of Millions) see this article: “Indian Currency format in Excel”

Newer posts →

Pages

  • About

Recent Posts

  • Enterprise / Server Cloud Storage (not “Personal” cloud storage)
  • “Free” SQL Databases
  • Timeseries Databases
  • June 2020 🔥🔥 New JS Bundlers/Builders
  • Quarantine one liners that will crack you up!

Twitter Stream

  • RT @joannalayton: This photo. What do you see? What jobs do you think they do? https://t.co/av0hlqLTQo 3 hours ago
  • @RonnieKStocks What's the best way to get in touch? I can't DM you: could you either set your DMs to "open" for all… twitter.com/i/web/status/1… 11 hours ago
  • @SJosephBurns 6. Low vol / Low Beta everything falls at the same time in a pandemic ;) - Not a good hedge. 11 hours ago
  • @SJosephBurns 4. Selling too early (esp. after a big up move). I now #hodl much longer and manage the fear by addin… twitter.com/i/web/status/1… 11 hours ago
  • @SJosephBurns 2. Buying #stonks based on tips from well meaning frnds and acquaintances, without actually understan… twitter.com/i/web/status/1… 11 hours ago

Create a free website or blog at WordPress.com.

Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy