…individuals with aggressive, rule-breaking and anti-social tendencies…are over-represented among benefit recipients.
Princeton Study - U.S. No Longer An Actual Democracy
American democracy no longer exists. I think the average American is aware of this - hence the popularity of Donald Trump. Throw the bums out!
Euler-98
https://projecteuler.net/problem=98
By replacing each of the letters in the word CARE with 1, 2, 9, and 6 respectively, we form a square number: 1296 = 36^2. What is remarkable is that, by using the same digital substitutions, the anagram, RACE, also forms a square number: 9216 = 96^2. We shall call CARE (and RACE) a square anagram word pair and specify further that leading zeroes are not permitted, neither may a different letter have the same digital value as another letter.
Using words.txt, a 16K text file containing nearly two-thousand common English words, find all the square anagram word pairs (a palindromic word is NOT considered to be an anagram of itself).
What is the largest square number formed by any member of such a pair?
NOTE: All anagrams formed must be contained in the given text file.
1 |
|
There are 1786 words, the longest is 14 characters and the smallest is 1 character. Since we have already been given the square anagram word pair CARE / RACE I will assume the answer is greater than 4 characters and ignore all 1-4 character words.
Write a function compare.word that will take 2 words, sort the characters and determine if the two words have the same characters.
1 | > compare.word <- function( a, b){ |
There are 19 anagrams with lengths of 5, 6, 8, or 9 characters.
Now figure out how many squares of length 5,6,8, or 9 exist.
These squares will be between 100^2 to 31623^2
1 |
|
There are about 41,000 squares. Assign a square to a word, rearrange according to the square pair, determine if the new word is in the anagram list.
1 |
|
CENTRE assigns different numbers to the ‘E’ violating one of the rules so BROAD/BOARD is the anagram pair and the largest square is 18769
Euler-17
https://projecteuler.net/problem=17
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total.
If all the numbers from 1 to 1000 (one thousand) inclusive were written out in words, how many letters would be used?
NOTE: Do not count spaces or hyphens. For example, 342 (three hundred and forty-two) contains 23 letters and 115 (one hundred and fifteen) contains 20 letters. The use of “and” when writing out numbers is in compliance with British usage.
1 | rm(list=ls(all=TRUE)) |
storj
Debian
I already have Node.js running so I only need to install the Storj related software.
1 | $npm install -g storjshare-cli |
Accept defaults for all prompts.
1NLS7qEXNYCMt6LJvDxzk4zM9XQBNdPTDx is my Storj address
1P3YYh7QRQvWXYzaTzyPDGUeRRgJi1nF28 is counterparty address
default store at ~/.storj/contracts.db
To convert units use: convertunits.com/from/GB/to/byte
GB | Bytes |
---|---|
100 | 107374182400 |
80 | 85899345920 |
60 | 64424509440 |
50 | 53687091200 |
Potential issues
To get contracts time must be synchronized properly.
Use NTP
1 |
|
Visudo
use as root command “groups” will tell you which groups you are in
visudo -f /etc/sudoers
Defaults=targetpw
ALL ALL=(ALL) ALL
You have two “modes”
Command mode – Press ‘ESC’ to access.
Insert mode – Press ‘I’ to access.
You’re always in one or the other.To move the insertion point around, press ‘ESC’ and use the arrow keys.
Once you’re where you want to be, press ‘I’ and start entering text.
To delete a character, you need to be in command mode, select the character and press the delete key. (Note: not the Backspace key) You can do this in insert mode, but it does some funky things with the text.
To save your changes, in command mode, type :w and press enter.
To quit, in command mode, type :q and press enter.
To quit without saving any changes, in command mode, type :q! and press enter.
To add your login to the sudo group:
$ su
adduser mbc sudo
FromRedhat
visudo
edit to look like:
Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
save and exit
usermod -aG wheel mbc
Now test that it worked:
su USERNAME -
$ groups
mbc wheel
$sudo whoami
after password prompt should return “root”
Arch
Arch Linux setup on Dell Inspiron 1720
https://wiki.archlinux.org/index.php/Beginners%27_Guide
http://lifehacker.com/5680453/build-a-killer-customized-arch-linux-installation-and-learn-all-about-linux-in-the-process
install script at http://pastebin.com/3Si2BDfv
to make a bootable flash drive:
wget http://archlinux.supersec.org/iso/2011.08.19/archlinux-2011.08.19-netinstall-i686.iso
also download sha1sums.txt
sha1sum –check sha1sums.txt (can eliminate all entries of no interest)
sudo blkid -o list -c /dev/null to see what USB is called
dd if=archlinux-2013.09.01-dual.iso of=/dev/sdb (!not /dev/sdb1)
pacman -Syu for a system upgrade
Do not use Unetbootin!
check /etc/hosts
Alt-F1 to switch to tty1
cfdisk /dev/sda1
Name Flags Part Type FS Type [Label] Size (MB)
sda1 Boot Primary Linux 160000
# mkfs.ext4 /dev/sda1
# lsblk /dev/sda1
# mount /dev/sda1 /mnt
# nano /etc/pacman.d/mirrorlist
use the rit server
Server = http://mirror.rit.edu/archlinux/$repo/os/$arch
…
# pacstrap -i /mnt base base-devel
# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab
# arch-chroot /mnt ;;use this to switch to /mnt
# nano /etc/locale.gen and uncomment en_US.UTF-8 UTF-8
;;;try /dev/sdb1, then /dev/sdc1 etc for usbs
# locale-gen (should see en_US.UTF-8 UTF-8… info)
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
# loadkeys us
# setfont Lat2-Terminus16
# nano /etc/vconsole.conf
echo KEYMAP=us > /etc/vconsole.conf
echo FONT=Lat2-Terminus16 >> /etc/vconsole.conf
# ls /usr/share/zoneinfo/US
# ln /usr/share/zoneinfo/US/Eastern /etc/localtime
# hwclock –systohc –utc
echo arch > /etc/hostname
# nano /etc/pacman.conf
# passwd root
;;to add user archie
# useradd -m -g users -G wheel -s /bin/bash archie
# passwd archie
# pacman -S sudo
# pacman -S grub-bions
# grub-install –target=i386-pc –recheck /dev/sda
# cp /usr/share/locale/en@quot/LC_MESSAGES/grub.mo /boot/grub/locale/en.mo
must correct bug by editing /etc/default/grub
add the line GRUB_DISABLE_SUBMENU=y
# grub-mkconfig -o /boot/grub/grub.cfg
# pacman -S ntpd i3 dmenu chromium
######for hp server
systemctl enable dhcpcd@enp2s15.service
uses 8139too and 8139cp. do not black list anything
do not need to add modules in rc.conf
#############
# exit
# umount /mnt/home
# umount /mnt
lspci | grep # reboot
Pacman
# pacman -S base-devel
mkdir ~/builds install tar.gzs in here and build
adjust mirrors in /etc/pacman.d/mirrorlist
$ cd ~/builds
$ tar -xvzf foo.tar.gz
$ cd foo
$ nano PKGBUILD
$ nano foo.install
$ makepkg -s
# pacman -U foo-0.1-1-i686.pkg.tar.xz upgrade command
$ pacman -Qm list foreign packages
# pacman -Syu upgrade entire system
# pacman -R package_name remove package but not dependencies
# pacman -R package_name remove a single package
# pacman -Rs package_name remove package and dependencies
$ pacman -Ql package_name files installed by a package
$ pacman -Qdt list all orphaned files
$ whoneeds package_name packages needed by a package
# pacman -U /path/to/package/package_name-version.pkg.tar.xz install local package
–install software—————————-
pacman -S unzip
pacman -S xulrunner
pacman -S pkgtools
pacman -S alsa-utils
pacman -S awesome
pacman -S git
pacman -S wget
pacman -S acpi (battery monitor and other stuff)
pacman -S libunistring required for Guile
pacman -S evince to read pdfs
– /etc/pacman.d/mirrorlist ——————
uncomment the rit.edu mirrors
–video—————————————
pacman -S xf86-video-intel
xorg-configure
chmod 755 /dev/mem
–shutdown———————————-
sudo shutdown -h now
–commands———————————
$ wgetpaste </path/to/file>
$ rm -r dir to rm dir and contetns
sudo chown -R mbc /home/mbc recursive claim ownership
–Xorg——————————————-
pacman -S xorg-server xorg-xinit xorg-utils xorg-server-utils xterm
$ lspci | grep VGA
# pacman -S xorg-twm xorg-xclock xterm
$ rm ~/.xinitrc (for testing)
pacman -S xorg-drivers (provides mouse support, 38 packages, may be able to reduce )
—sound—————————————
user must be made member of audio group
#gpasswd -a mbc audio (mbc is user login id)
must relogin for it to take effect
alsamixer turn speaker and headphones up;
headphones seems to control speakers!!!
speaker-test -c 8
—–manage keys——————————
pacman-key –init
pacman-key –populate archlinux
pacman -Syy
#to refresh keys
pacman -Sc && rm /var/lib/pacman/sync
pacman-key –refresh-keys
—Conkeror———————————–
pacman -S desktop-file-utils
git clone http://repo.or.cz/r/conkeror.git
nano conkeror.sh
#!/bin/bash
exec xulrunner /path/to/conkeror/application.ini “$@”
chmod 700 conkeror.sh
–USB stick—————————————
mkdir /mnt/usbstick
sudo blkid -o list -c /dev/null to see what it is called
sudo mount /dev/sdb1 /mnt/usbstick
sudo chown -R dad /mnt/usbstick ( -R for recursive)
autologin—————————————-
# cp /usr/lib/systemd/system/getty@.service /etc/systemd/system/autologin@.service
/etc/systemd/system/autologin@.service
[Service]
[…]
ExecStart=-/sbin/agetty –noclear -a USERNAME %I 38400
[…]
# systemctl daemon-reload
# systemctl disable getty@tty1
# systemctl enable autologin@tty1
# systemctl start autologin@tty1
autostart X
~/.bash_profile include at end (spaces important)
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && exec startx
shutdown——
shutdown now
LAN card
# lspci | grep -i Ethernet
$ ping -c 3 www.google.com
UDEV———————————
wifi module: ipw2200
pacman -Ss 2200-fw (2200BG Calexico2 is the card)
http://serverfault.com/questions/63764/create-home-directories-after-create-users
Create directory in compliance to /etc/passwd, usually there will be already a /home/login entry.
Copy initial files from /etc/skel
And finally set right permissions:
mkdir /home/YOU
cd /home/YOU
cp -r /etc/skel/.* /etc/skel/* .
chown -R YOU.YOURGROUP .
chmod -R go=u,go-w .
chmod go= .
for inspron1720
# lspci | grep -i Ethernet
/etc/rc.conf
MODULES=(b44)
ip link set eth0 up
WIFI———————————-
# lspci | grep -i net
# ip link set wlan0 up
# iwlist wlan0 scan
# iwconfig wlan0 essid “GFPF1” key 1F9024CF7C
# chatham ancientgiant595
#iwconfig ;;and look for name
#iwconfig wlan0 to check access
wifi-menu to generate config file
netctl enable wlan0-GFPF1 (config file is in /etc/netctl)
####time
pacman -S ntpd
systemctl enable ntpd
Android developmment————————
pacman -S jdk7-openjdk
download and unzip android-sdk_r16-linux.tgz
unrar x avd.rar
sudo chown -R mbc /home/mbc recursive claim ownership
cd /android-sdk-linux/tools/
$ ./android
Economics
17% of working-age adults earned more from their house than from their job
Stock buybacks enrich the rich - Ralph Nader