Building Bootstrap 4 with Sass - result not same as dist/bootstrap.css - sass

I'm new to Sass and trying to compile Bootstrap so I can change the md breakpoint such that a menu will display in touch mode on a 7inch tablet.
Before I made any changes, I thought I'd make sure I can compile it OK by doing a diff on my complied version vs the one on the dist directory - however the file I've complied is over 20kb smaller than the one in dist (V4 downloaded today).
I open the files hoping it would be just whitespace and comments, but there are actual differences in the CSS.
My build process is below.
$ sass -v
Sass 3.5.5 (Bleeding Edge)
$ pwd
/Volumes/projects/xx/resp/bootstrap-4.0.0
$ dir
drwxrwxr-x 4 xx staff 16384 12 Feb 2018 dist
...
drwxrwxr-x 4 xx staff 16384 12 Feb 2018 scss
$ sass -f scss/bootstrap.scss dist/css/TESTbootstrap.css
$ dir dist/css
-rwxrw-r-- 1 kevin xx 152719 12 Feb 2018 TESTbootstrap.css
...
-rwxrw-r-- 1 kevin x 178152 18 Jan 10:29 bootstrap.css

Related

What does -> mean and why are they in this folder?

I noticed that installing the grunt-cli did this. It looks like a symbolic link or something similar.
lrwxr-xr-x 1 root admin 39 Jan 9 2016 grunt -> ../lib/node_modules/grunt-cli/bin/grunt
lrwxr-xr-x 1 root admin 28 Nov 3 2015 heroku -> /usr/local/heroku/bin/heroku
-rwxrwxr-x 1 root wheel 23369552 Dec 23 2015 node
lrwxr-xr-x 1 root admin 38 Jan 10 2016 npm -> ../lib/node_modules/npm/bin/npm-cli.js
lrwxr-xr-x 1 a admin 64 Mar 22 2016 subl -> /Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl
-rwxr-xr-x 1 root wheel 75 Apr 28 06:32 vbox-img
-rwxr-xr-x 1 root wheel 77 Apr 28 06:32 vboxwebsrv
More importantly, why is it doing this?
/usr/local/bin/grunt -> /usr/local/lib/node_modules/grunt-cli/bin/grunt
Indeed, the -> indicates the file is a "symbolic link" ( aka "symlink" ) — the l in front of the permissions is also an indicator of it's type. Essentially filename a redirects to filename b at it's location ... a -> b.
You can create a symlink simply by doing:
$ ln -s <target> <original>
When creating a symlink it's the reverse of a -> b. ( In other words, while creating the symlink you would "link symbolically (ln -s) <target> (b) to <original> (a)" )...
Why /usr/local/bin/grunt goes to /usr/local/lib/node_modules/grunt-cli/bin/grunt is something you'd have to ask the developer, although my guess is that by doing:
$ grunt
...it's much more convenient than doing:
$ /usr/local/lib/node_modules/grunt-cli/bin/grunt
If the symlink wasn't indicated as it is in /usr/local/bin then you'd be using the latter...

Where is locale_gen localted on FreeBSD?

I have only two locales installed
$ locale -a
C
POSIX
I want to use utf-8 character encoding and hence want to install en_US.UTF-8
For ubuntu I found locale_gen which does the job. Is this utility, or any similar utility present for FreeBSD? If yes, could you please tell me its location? Thanks
I followed this guide to install UTF-8 locale. This is how it looks like in my terminal once that's set up:
g#crayon2:~ % locale
LANG=en_GB.UTF-8
LC_CTYPE="en_GB.UTF-8"
LC_COLLATE="en_GB.UTF-8"
LC_TIME="en_GB.UTF-8"
LC_NUMERIC="en_GB.UTF-8"
LC_MONETARY="en_GB.UTF-8"
LC_MESSAGES="en_GB.UTF-8"
LC_ALL=
Copying from there this is what I changed:
/etc/login.conf
--- login.conf.default 2012-01-02 17:08:05.804291477 -0500
+++ login.conf 2012-01-02 17:08:16.996213774 -0500
## -44,7 +44,9 ##
\:pseudoterminals=unlimited:\
\:priority=0:\
\:ignoretime#:\
- \:umask=022:
+ \:umask=022:\
+ \:charset=UTF-8:\
+ \:lang=en_US.UTF-8:
Rebuild the login database with cap_mkdb /etc/login.conf after making changes.
/etc/profile
LANG=en_US.UTF-8; export LANG
CHARSET=UTF-8; export CHARSET
GDM_LANG=en_US.UTF-8; export GDM_LANG
Of course I used en_GB rather than en_US as you can tell.
Edit:
The locale files are located in /usr/share/locale:
g#crayon2:/usr/share/locale % ls -l
total 1423
drwxr-xr-x 2 root wheel 3 11 Nov 2014 UTF-8
drwxr-xr-x 2 root wheel 8 11 Nov 2014 af_ZA.ISO8859-1
drwxr-xr-x 2 root wheel 8 11 Nov 2014 af_ZA.ISO8859-15
drwxr-xr-x 2 root wheel 8 11 Nov 2014 af_ZA.UTF-8
drwxr-xr-x 2 root wheel 8 11 Nov 2014 am_ET.UTF-8
drwxr-xr-x 2 root wheel 8 11 Nov 2014 be_BY.CP1131
drwxr-xr-x 2 root wheel 8 11 Nov 2014 be_BY.CP1251
drwxr-xr-x 2 root wheel 8 11 Nov 2014 be_BY.ISO8859-5
(..)
These files are not part of any port, they are part of the base.txz archive available from the FreeBSD ftp server:
g#crayon2:~/Downloads % tar -tzf base.txz | grep "usr/share/locale"
./usr/share/locale/
./usr/share/locale/lt_LT.ISO8859-4/
./usr/share/locale/en_GB.ISO8859-15/
./usr/share/locale/kk_KZ.PT154/
./usr/share/locale/it_IT.ISO8859-15/
./usr/share/locale/hy_AM.UTF-8/
./usr/share/locale/en_IE.UTF-8/
./usr/share/locale/zh_HK.UTF-8/
./usr/share/locale/en_AU.ISO8859-1/
./usr/share/locale/zh_CN.eucCN/
./usr/share/locale/fr_BE.ISO8859-15/
./usr/share/locale/en_AU.UTF-8/
(...)

Use newsyslog to rotate log files, but only if they have a certain size

I'm on OS X 10.9.4 and trying to use newsyslog to rotate my app development log files.
More specifically, I want to rotate the files daily but only if they are not empty (newsyslog writes one or two lines to every logfile it rotates, so let's say I only want to rotate logs that are at least 1kb).
I created a file /etc/newsyslog.d/code.conf:
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/Users/manuel/code/**/log/*.log manuel:staff 644 7 1 $D0 GN
The way I understand the man page for the configuration file is that size and when conditions should work in combination, so logfiles should be rotated every night at midnight only if they are 1kb or larger.
Unfortunately this is not what happens. The log files are rotated every night, no matter if they only the rotation message from newsyslog or anything else:
~/code/myapp/log (master) $ ls
total 32
drwxr-xr-x 6 manuel staff 204B Aug 8 00:17 .
drwxr-xr-x 22 manuel staff 748B Jul 25 14:56 ..
-rw-r--r-- 1 manuel staff 64B Aug 8 00:17 development.log
-rw-r--r-- 1 manuel staff 153B Aug 8 00:17 development.log.0
~/code/myapp/log (master) $ cat development.log
Aug 8 00:17:41 localhost newsyslog[81858]: logfile turned over
~/code/myapp/log (master) $ cat development.log.0
Aug 7 00:45:17 Manuels-MacBook-Pro newsyslog[34434]: logfile turned over due to size>1K
Aug 8 00:17:41 localhost newsyslog[81858]: logfile turned over
Any tips on how to get this working would be appreciated!
What you're looking for (rotate files daily unless they haven't logged anything) isn't possible using newsyslog. The man page you referenced doesn't say anything about size and when being combined other than to say that if when isn't specified, than it is as-if only size was specified. The reality is that the log is rotated when either condition is met. If the utility is like its FreeBSD counterpart, it won't rotate logs less than 512 bytes in size unless the binary flag is set.
MacOS' newer replacement for newsyslog, ASL, also doesn't have the behavior you desire. As far as I know, the only utility which has this is logrotate using its notifempty configuration option. You can install logrotate on your Mac using Homebrew

cd command does not see the directory in bash

I have the following bash script:
#!/bin/bash
run_python(){
cd "`dirname $1`"
python "`basename $1`" $2 >test.log
}
crypto_util=/home/dev/src/crypto/util.py
run_python $crypto_util "testpassword"
Somehow cd command fails saying:
cd: /home/dev/src/crypto No such file or directory. I am quite sure the directory exists.
On a side note if I do the following this fails too:
run_python(){
python "$1" $2 >test.log
}
Saying python can not open the file /home/dev/src/crypto/util.py because there is no such file.
Any idea why?
Here is the output of the ll command on the directory/file:
drwxr--r--. 2 dev root 4096 Jun 11 18:56 crypto
-rwxr--r--. 1 dev root 4934 Jun 9 10:50 util.py
Output of ls -llid /home/
654084 drwxr-xr-x. 4 root root 4096 May 8 10:52 /home
Output of ls -lid /home/dev/
924265 drwxr--r--. 4 dev root 4096 Jun 9 09:17 /home/dev/
Output of ls -lid/home/dev/src/:
924266 drwxr--r--. 9 dev root 4096 Jun 9 10:01 /home/dev/src/
Output of ls -lid/home/dev/src/crypto:
924333 drwxr--r--. 2 dev root 4096 Jun 11 18:56 /home/dev/src/crypto/
Output of ls -lid/home/dev/src/crypto/util.py:
924337 -rwxr--r--. 1 dev root 4934 Jun 9 10:50 /home/dev/src/crypto/util.py
some of those dirs don't have x permission bit set - those are needed for entering a directory. Your problem may be that your scripts are running with another user as owner than "dev". dev is the only user allowed to change to those directories.
Set the dirs to +x, and try again.

Use rsync to copy only hidden files

I want to back up all the hidden files and directories in my homedir using rsync, but not the non-hidden files and directories.
For example, given this directory listing:
drwxr-xr-x 7 sophie sophie 238 31 Mar 08:45 .
drwxr-xr-x 15 sophie sophie 510 31 Mar 08:14 ..
-rw-r--r-- 1 sophie sophie 4 31 Mar 08:12 .foo
drwxr-xr-x 3 sophie sophie 102 31 Mar 08:45 .hiddendir
drwxr-xr-x 4 sophie sophie 136 31 Mar 08:13 VisibleDirectory
-rw-r--r-- 1 sophie sophie 9 31 Mar 08:13 VisibleFile
I want to back up .foo, .hiddendir, and all the contents of .hiddendir whether they are hidden or not. I don't want to back up VisibleDirectory or VisibleFile.
All the incantations I have come up with back up ".", and therefore all its contents including VisibleFile and VisibleDirectory, and I can't figure out how to exclude it. Please help!
I'm using Mac OS X 10.5.6 (Leopard) and rsync version 2.6.9 protocol version 29.
A common pattern to match the hidden items is .[^.]*
rsync -a ~/.[^.]* /path/to/backup
This copies all files starting with a single dot. Note that it doesn't include files starting with more than one dot.
It's usually ".??*" to make sure you don't copy "." and ".."
(What if you had a file that was just ".a" ?)
Have you tried incarnations like ./.*?
Could you copy the hidden files to a temp directory, back up the temp directory, then remove it?

Resources